Safe HaskellNone

IHP.LoginSupport.Helper.Controller

Synopsis

Documentation

currentUser :: forall user. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, FrameworkConfig, HasNewSessionUrl user, Typeable user, user ~ CurrentUserRecord) => user Source #

currentUserOrNothing :: forall user. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, FrameworkConfig, HasNewSessionUrl user, Typeable user, user ~ CurrentUserRecord) => Maybe user Source #

currentUserId :: forall user userId. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, FrameworkConfig, HasNewSessionUrl user, HasField "id" user userId, Typeable user, user ~ CurrentUserRecord) => userId Source #

ensureIsUser :: forall user userId. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, FrameworkConfig, HasNewSessionUrl user, HasField "id" user userId, Typeable user, user ~ CurrentUserRecord) => IO () Source #

class HasNewSessionUrl user Source #

Minimal complete definition

newSessionUrl

currentAdmin :: forall admin. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, FrameworkConfig, HasNewSessionUrl admin, Typeable admin) => admin Source #

currentAdminOrNothing :: forall admin. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, FrameworkConfig, HasNewSessionUrl admin, Typeable admin) => Maybe admin Source #

currentAdminId :: forall admin adminId. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, FrameworkConfig, HasNewSessionUrl admin, HasField "id" admin adminId, Typeable admin) => adminId Source #

ensureIsAdmin :: forall admin adminId. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, FrameworkConfig, HasNewSessionUrl admin, Typeable admin) => IO () Source #

login :: forall user id. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, ?requestContext :: RequestContext, KnownSymbol (GetModelName user), HasField "id" user id, Show id) => user -> IO () Source #

Log's in an entity Examples: ``` let user :: User = ... in login user let admin :: Admin = ... in login admin ```

sessionKey :: forall user. KnownSymbol (GetModelName user) => Text Source #

logout :: forall user id. (?controllerContext :: ControllerContext, ?requestContext :: RequestContext, ?requestContext :: RequestContext, KnownSymbol (GetModelName user), HasField "id" user id, Show id) => user -> IO () Source #