From b69481e88fb20890b4ece7a0023dcfdad21604d6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 12 Oct 2020 10:54:27 +0200 Subject: [PATCH] fix(authorization): have AllocationTime consider ParticipantState --- src/Foundation/Authorization.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Foundation/Authorization.hs b/src/Foundation/Authorization.hs index 9b7b211bd..3f479f5df 100644 --- a/src/Foundation/Authorization.hs +++ b/src/Foundation/Authorization.hs @@ -784,7 +784,7 @@ tagAccessPredicate AuthAllocationTime = APDB $ \mAuthId route _ -> case route of Nothing -> return Authorized Just (cid, Allocation{..}) -> do registered <- case mAuthId of - Just uid -> $cachedHereBinary (uid, cid) . existsBy $ UniqueParticipant uid cid + Just uid -> $cachedHereBinary (uid, cid) $ exists [ CourseParticipantUser ==. uid, CourseParticipantCourse ==. cid, CourseParticipantState ==. CourseParticipantActive ] _ -> return False if | not registered