thentos-core-0.0.1.1: The swiss army knife of privacy-preserving identity management

Safe HaskellUnsafe
LanguageHaskell2010

Thentos.Action.SimpleAuth

Description

Simplified access to Action with guarded exits.

Synopsis

Documentation

newtype UnsafeAction e s a

Like Action, but with IO at the base.

Constructors

UnsafeAction 

Fields

fromUnsafeAction :: ReaderT ActionState (EitherT (ThentosError e) (StateT s IO)) a
 

Instances

MonadReader ActionState (UnsafeAction e s) 
MonadState s (UnsafeAction e s) 
MonadError (ThentosError e) (UnsafeAction e s) 
Monad (UnsafeAction e s) 
Functor (UnsafeAction e s) 
Applicative (UnsafeAction e s) 
MonadIO (UnsafeAction e s) 
Generic (UnsafeAction e s a) 
type Rep (UnsafeAction e s a) 

assertAuth :: Action e s Bool -> Action e s ()

Run boolean authorization predicate. Throw ActionErrorAnyLabel if the result is False.

guardedUnsafeAction :: Action e s Bool -> UnsafeAction e s a -> Action e s a

Run an UnsafeAction in a safe Action with extra authorization checks (performed through assertAuth).

unsafeAction :: forall e s a. UnsafeAction e s a -> Action e s a

Run an UnsafeAction in a safe Action without extra authorization checks.