From d5edf5ee7b9a7098554f596d9e481560266c018a Mon Sep 17 00:00:00 2001 From: SJost Date: Fri, 25 May 2018 10:11:06 +0200 Subject: [PATCH] liftAR refactored to avoid unnecessary DB access --- src/Foundation.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Foundation.hs b/src/Foundation.hs index f488b367c..10cded5a3 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -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