databrary-1: Databrary

Safe HaskellNone
LanguageHaskell2010

Model.Authorize

Synopsis

Documentation

lookupAuthorizedChildren :: (MonadDB c m, MonadHasIdentity c m) => Party -> Maybe Permission -> m [Authorize] Source #

Get authorizations where the given party is the parent. When the permission argument has a value, then only provide active, approved authorizations, filtering out authorizations lower than the provided level.

lookupAuthorizedParents :: (MonadDB c m, MonadHasIdentity c m) => Party -> Maybe Permission -> m [Authorize] Source #

Get authorizations where the given party is the child. When the permission argument has a value, then only provide active, approved authorizations, filtering out authorizations lower than the provided level.

lookupAuthorize :: MonadDB c m => AuthorizeFilter -> Party -> Party -> m (Maybe Authorize) Source #

Attempt to find an authorization request or grant from the child party to the granting parent party. If authorize filter is ForPartyViewer, filter out expired authorizations.

lookupAuthorizeParent :: (MonadDB c m, MonadHasIdentity c m) => Party -> Id Party -> m (Maybe Authorize) Source #

Find an active authorization request or approval from child to parent.

lookupAuthorization :: (MonadDB c m, MonadHasIdentity c m) => Party -> Party -> m Authorization Source #

Get the core active authorization entry between a child and parent, after inheritance has been applied. Override authorize_view for the corner case of nobody as both parent and child.

changeAuthorize :: MonadAudit c m => Authorize -> m () Source #

Update or insert the authorization object. Use the request and identity context to log the change in the corresponding audit table as well.