Safe Haskell | None |
---|---|
Language | Haskell2010 |
- selectPartyRow :: Selector
- selectParty :: Name -> Selector
- selectPartyAuthorization :: Name -> Selector
- selectAuthParty :: Name -> Selector
- selectAccount :: Name -> Selector
- selectUserAccount :: Selector
- selectSiteAuth :: Selector
- updateParty :: Name -> Name -> ExpQ
- updateAccount :: Name -> Name -> ExpQ
- insertParty :: Name -> Name -> ExpQ
- insertAccount :: Name -> Name -> ExpQ
- deleteParty :: Name -> Name -> ExpQ
- deleteAccount :: Name -> Name -> ExpQ
- makeSiteAuth :: Account -> Maybe ByteString -> Maybe Access -> SiteAuth
- makeUserAccount :: (Permission -> Maybe Access -> Account) -> Account
- makeAccount :: PartyRow -> (Party -> Account) -> Permission -> Maybe Access -> Account
- makePartyAuthorization :: Party -> Maybe Access -> (Party, Maybe Permission)
- permissionParty :: Has (Id Party) a => (Permission -> Maybe Access -> a) -> Maybe Access -> Identity -> a
- makeParty :: PartyRow -> Maybe (Party -> Account) -> Permission -> Maybe Access -> Party
- makeParty2 :: PartyRow -> Maybe (Party -> Account) -> Loaded Permission -> Permission -> Maybe Access -> Party
Documentation
selectPartyAuthorization Source #
:: Name | |
-> Selector | ( |
makeSiteAuth :: Account -> Maybe ByteString -> Maybe Access -> SiteAuth Source #
Build a SiteAuth object using the provided Account, possible password, and possible access object. If no access object is provided, then use (None, None) for the access object.
makeUserAccount :: (Permission -> Maybe Access -> Account) -> Account Source #
Build an account, using ADMIN permission and (ADMIN,ADMIN) access object. Essentially a user has full permissions over themselves and the access object nested within the account party has max privileges. I suspect that the access object within a Party, when nested inside of a SiteAuth is almost never used, as the Has instances all retrieve siteAccess, not (partyAccess . accountParty . siteAccount)
makeAccount :: PartyRow -> (Party -> Account) -> Permission -> Maybe Access -> Account Source #
Used by makeUserAccount
and selectPermissionAccount
. This finishes building the circular Party and Account structure.
makePartyAuthorization :: Party -> Maybe Access -> (Party, Maybe Permission) Source #
:: Has (Id Party) a | |
=> (Permission -> Maybe Access -> a) | Partially applied makeParty, ready to build full account or party |
-> Maybe Access | The direct authorization that the party/account being built may have authorized to the viewing identity/user. This is only used by lookupAuthParty, which is only used in the context of retreiving a party for editing/viewing in isolation by the party controller actions |
-> Identity | The viewing identity / user which is trying to view or edit the party being retrieved. |
-> a | account or party |
Build an account or party, based on calling context. Compute permission and access by coalescing authorization granted directly and generally
makeParty :: PartyRow -> Maybe (Party -> Account) -> Permission -> Maybe Access -> Party Source #
Build party, with a circular connection to an account if an account creation function is provided
makeParty2 :: PartyRow -> Maybe (Party -> Account) -> Loaded Permission -> Permission -> Maybe Access -> Party Source #
Build party, with a circular connection to an account if an account creation function is provided. Transition function taking mSiteAccess until all queries use this.