Apply 1 suggestion(s) to 1 file(s)

This commit is contained in:
Sarah Vaupel 2020-08-10 11:37:38 +02:00
parent 3d35b69cfb
commit 5b4df3c6b1

View File

@ -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