fix(auth): wrong caching for external-exam-staff
This commit is contained in:
parent
72191315b6
commit
9d1f1c6910
@ -401,7 +401,7 @@ data AuthorizationCacheKey
|
|||||||
| AuthCacheWorkflowInstanceInitiators WorkflowInstanceName RouteWorkflowScope
|
| AuthCacheWorkflowInstanceInitiators WorkflowInstanceName RouteWorkflowScope
|
||||||
| AuthCacheWorkflowInstanceWorkflowViewers WorkflowInstanceName RouteWorkflowScope
|
| AuthCacheWorkflowInstanceWorkflowViewers WorkflowInstanceName RouteWorkflowScope
|
||||||
| AuthCacheSchoolFunctionList SchoolFunction | AuthCacheSystemFunctionList SystemFunction
|
| AuthCacheSchoolFunctionList SchoolFunction | AuthCacheSystemFunctionList SystemFunction
|
||||||
| AuthCacheLecturerList | AuthCacheCorrectorList | AuthCacheExamCorrectorList | AuthCacheTutorList | AuthCacheSubmissionGroupUserList
|
| AuthCacheLecturerList | AuthCacheExternalExamStaffList | AuthCacheCorrectorList | AuthCacheExamCorrectorList | AuthCacheTutorList | AuthCacheSubmissionGroupUserList
|
||||||
| AuthCacheCourseRegisteredList TermId SchoolId CourseShorthand
|
| AuthCacheCourseRegisteredList TermId SchoolId CourseShorthand
|
||||||
deriving (Eq, Ord, Read, Show, Generic, Typeable)
|
deriving (Eq, Ord, Read, Show, Generic, Typeable)
|
||||||
deriving anyclass (Hashable, Binary)
|
deriving anyclass (Hashable, Binary)
|
||||||
@ -660,7 +660,10 @@ tagAccessPredicate AuthLecturer = cacheAP' (Just $ Right diffMinute) mkLecturerL
|
|||||||
mkLecturerList _ route _ = case route of
|
mkLecturerList _ route _ = case route of
|
||||||
CourseR{} -> cacheLecturerList
|
CourseR{} -> cacheLecturerList
|
||||||
AllocationR{} -> cacheLecturerList
|
AllocationR{} -> cacheLecturerList
|
||||||
EExamR{} -> cacheLecturerList
|
EExamR{} -> Just
|
||||||
|
( AuthCacheExternalExamStaffList
|
||||||
|
, runDBRead . fmap (setOf $ folded . _Value) . E.select . E.from $ return . (E.^. ExternalExamStaffUser)
|
||||||
|
)
|
||||||
_other -> Just
|
_other -> Just
|
||||||
( AuthCacheSchoolFunctionList SchoolLecturer
|
( AuthCacheSchoolFunctionList SchoolLecturer
|
||||||
, runDBRead . fmap (setOf $ folded . _Value) . E.select . E.from $ \userFunction -> do
|
, runDBRead . fmap (setOf $ folded . _Value) . E.select . E.from $ \userFunction -> do
|
||||||
|
|||||||
@ -55,6 +55,7 @@ postEEEditR tid ssh coursen examn = do
|
|||||||
when (is _Nothing replaceRes) $ do
|
when (is _Nothing replaceRes) $ do
|
||||||
audit $ TransactionExternalExamEdit eeId
|
audit $ TransactionExternalExamEdit eeId
|
||||||
|
|
||||||
|
memcachedByInvalidate AuthCacheExternalExamStaffList $ Proxy @(Set UserId)
|
||||||
forM_ (eefStaff `setSymmDiff` staff) $ \change -> if
|
forM_ (eefStaff `setSymmDiff` staff) $ \change -> if
|
||||||
| change `Set.member` eefStaff -> case change of
|
| change `Set.member` eefStaff -> case change of
|
||||||
Left invEmail -> do
|
Left invEmail -> do
|
||||||
|
|||||||
@ -42,6 +42,7 @@ postEExamNewR = do
|
|||||||
forM_ eefOfficeSchools' $ \ExternalExamOfficeSchool{..} ->
|
forM_ eefOfficeSchools' $ \ExternalExamOfficeSchool{..} ->
|
||||||
audit $ TransactionExternalExamOfficeSchoolEdit eeId externalExamOfficeSchoolSchool
|
audit $ TransactionExternalExamOfficeSchoolEdit eeId externalExamOfficeSchoolSchool
|
||||||
|
|
||||||
|
memcachedByInvalidate AuthCacheExternalExamStaffList $ Proxy @(Set UserId)
|
||||||
let (invites, adds) = partitionEithers $ Set.toList eefStaff
|
let (invites, adds) = partitionEithers $ Set.toList eefStaff
|
||||||
eefStaff' = do
|
eefStaff' = do
|
||||||
externalExamStaffUser <- adds
|
externalExamStaffUser <- adds
|
||||||
|
|||||||
Reference in New Issue
Block a user