Apply 1 suggestion(s) to 1 file(s)
This commit is contained in:
parent
3d35b69cfb
commit
5b4df3c6b1
@ -535,11 +535,7 @@ tagAccessPredicate AuthExamOffice = APDB $ \mAuthId route _ -> case route of
|
|||||||
return Authorized
|
return Authorized
|
||||||
CourseR _ ssh _ _ -> $cachedHereBinary (mAuthId, ssh) . exceptT return return $ do
|
CourseR _ ssh _ _ -> $cachedHereBinary (mAuthId, ssh) . exceptT return return $ do
|
||||||
authId <- maybeExceptT AuthenticationRequired $ return mAuthId
|
authId <- maybeExceptT AuthenticationRequired $ return mAuthId
|
||||||
isExamOffice <- lift $ exists
|
isExamOffice <- lift . existsBy $ UniqueUserFunction authId ssh SchoolExamOffice
|
||||||
[ UserFunctionUser ==. authId
|
|
||||||
, UserFunctionFunction ==. SchoolExamOffice
|
|
||||||
, UserFunctionSchool ==. ssh
|
|
||||||
]
|
|
||||||
guardMExceptT isExamOffice $ unauthorizedI MsgUnauthorizedExamExamOffice
|
guardMExceptT isExamOffice $ unauthorizedI MsgUnauthorizedExamExamOffice
|
||||||
return Authorized
|
return Authorized
|
||||||
_other -> $cachedHereBinary mAuthId . exceptT return return $ do
|
_other -> $cachedHereBinary mAuthId . exceptT return return $ do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user