liftAR refactored to avoid unnecessary DB access

This commit is contained in:
SJost 2018-05-25 10:11:06 +02:00
parent f4964dcb55
commit d5edf5ee7b

View File

@ -157,6 +157,7 @@ knownTags =
Nothing -> unauthorizedI $ MsgUnauthorizedSchoolLecturer
(Just _) -> return Authorized
)
-- TODO: Continue here!!!
]
declareWrapped [d|
@ -170,6 +171,13 @@ getAccess r = DNF $ Set.map attrsAND attrsOR
attrsOR = routeAttrs r
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