From 5b4df3c6b1aa0c47866ec2ee1d4bcdf30e609a7b Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Mon, 10 Aug 2020 11:37:38 +0200 Subject: [PATCH] Apply 1 suggestion(s) to 1 file(s) --- src/Foundation.hs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index ed1ba5598..f0f7b11d6 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -535,11 +535,7 @@ tagAccessPredicate AuthExamOffice = APDB $ \mAuthId route _ -> case route of return Authorized CourseR _ ssh _ _ -> $cachedHereBinary (mAuthId, ssh) . exceptT return return $ do authId <- maybeExceptT AuthenticationRequired $ return mAuthId - isExamOffice <- lift $ exists - [ UserFunctionUser ==. authId - , UserFunctionFunction ==. SchoolExamOffice - , UserFunctionSchool ==. ssh - ] + isExamOffice <- lift . existsBy $ UniqueUserFunction authId ssh SchoolExamOffice guardMExceptT isExamOffice $ unauthorizedI MsgUnauthorizedExamExamOffice return Authorized _other -> $cachedHereBinary mAuthId . exceptT return return $ do