diff --git a/src/Handler/Course/Application/Edit.hs b/src/Handler/Course/Application/Edit.hs index bd7615614..0ffa0f5b9 100644 --- a/src/Handler/Course/Application/Edit.hs +++ b/src/Handler/Course/Application/Edit.hs @@ -21,8 +21,10 @@ postCAEditR tid ssh csh cID = do return (mAlloc, course, app, appUser) isAdmin <- case mAlloc of - Just alloc -> hasWriteAccessTo $ SchoolR (alloc ^. _entityVal . _allocationSchool) SchoolEditR - Nothing -> hasWriteAccessTo $ SchoolR (course ^. _entityVal . _courseSchool ) SchoolEditR + Just (Entity _ Allocation{..}) + -> hasWriteAccessTo $ SchoolR allocationSchool SchoolEditR + Nothing + -> hasWriteAccessTo $ SchoolR courseSchool SchoolEditR afmLecturer <- hasWriteAccessTo $ CourseR courseTerm courseSchool courseShorthand CEditR afmApplicantEdit <- hasWriteAccessTo $ CApplicationR tid ssh csh cID CAEditR -- TODO: Wrong. courseCID <- encrypt cid :: Handler CryptoUUIDCourse