liftAR refactored to avoid unnecessary DB access
This commit is contained in:
parent
f4964dcb55
commit
d5edf5ee7b
@ -157,6 +157,7 @@ knownTags =
|
|||||||
Nothing -> unauthorizedI $ MsgUnauthorizedSchoolLecturer
|
Nothing -> unauthorizedI $ MsgUnauthorizedSchoolLecturer
|
||||||
(Just _) -> return Authorized
|
(Just _) -> return Authorized
|
||||||
)
|
)
|
||||||
|
-- TODO: Continue here!!!
|
||||||
]
|
]
|
||||||
|
|
||||||
declareWrapped [d|
|
declareWrapped [d|
|
||||||
@ -170,6 +171,13 @@ getAccess r = DNF $ Set.map attrsAND attrsOR
|
|||||||
attrsOR = routeAttrs r
|
attrsOR = routeAttrs r
|
||||||
attrsAND = Set.fromList . Map.elems . Map.restrictKeys knownTags . Set.fromList . splitOn "AND"
|
attrsAND = Set.fromList . Map.elems . Map.restrictKeys knownTags . Set.fromList . splitOn "AND"
|
||||||
|
|
||||||
|
evalAccess :: Route -> DB Authorized
|
||||||
|
evalAccess = undefined -- TODO -- ^ uses `getAccess`
|
||||||
|
|
||||||
|
evalAccess' :: Route -> Handler UniWorX Authorized
|
||||||
|
evalAccess = undefined -- TODO -- ^ uses `getAccess`
|
||||||
|
|
||||||
|
-- TODO: isAuthorized = evalAccess'
|
||||||
|
|
||||||
|
|
||||||
-- Menus and Favourites
|
-- Menus and Favourites
|
||||||
|
|||||||
Reference in New Issue
Block a user