From a9636af13a86d405b03b538e5489ecb2d30c4294 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 7 Feb 2020 11:21:14 +0100 Subject: [PATCH] fix: merge --- messages/uniworx/de-de-formal.msg | 3 +++ messages/uniworx/en-eu.msg | 3 +++ records.json | 6 ++++-- src/Foundation.hs | 2 ++ src/Handler/Exam/Form.hs | 2 +- src/Model/Types/Security.hs | 1 + 6 files changed, 14 insertions(+), 3 deletions(-) diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index 55f9fa90a..cce2b0a23 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -412,6 +412,7 @@ UnauthorizedLecturer: Sie sind nicht als Veranstalter für diese Veranstaltung e UnauthorizedAllocationLecturer: Sie sind nicht als Veranstalter für eine Veranstaltung dieser Zentralanmeldung eingetragen. UnauthorizedCorrector: Sie sind nicht als Korrektor für diese Veranstaltung eingetragen. UnauthorizedSheetCorrector: Sie sind nicht als Korrektor für dieses Übungsblatt eingetragen. +UnauthorizedExamCorrector: Sie sind nicht als Korrektor für diese Prüfung eingetragen. UnauthorizedCorrectorAny: Sie sind nicht als Korrektor für eine Veranstaltung eingetragen. UnauthorizedRegistered: Sie sind nicht als Teilnehmer für diese Veranstaltung registriert. UnauthorizedAllocationRegistered: Sie sind nicht als Teilnehmer für diese Zentralanmeldung registriert. @@ -1189,6 +1190,7 @@ MenuExamEdit: Bearbeiten MenuExamUsers: Teilnehmer MenuExamGrades: Prüfungsleistungen MenuExamAddMembers: Prüfungsteilnehmer hinzufügen +MenuExamCorrect: Prüfungsergebnisse eintragen MenuExamOfficeExams: Prüfungen MenuExamOfficeFields: Fächer MenuExamOfficeUsers: Benutzer @@ -1291,6 +1293,7 @@ AuthTagDeprecated: Seite ist nicht überholt AuthTagDevelopment: Seite ist nicht in Entwicklung AuthTagLecturer: Nutzer ist Dozent AuthTagCorrector: Nutzer ist Korrektor +AuthTagExamCorrector: Nutzer ist Klausurkorrektor AuthTagTutor: Nutzer ist Tutor AuthTagTutorControl: Tutoren haben Kontrolle über ihre Tutorium AuthTagTime: Zeitliche Einschränkungen sind erfüllt diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index 901b10599..4f7c2b67c 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -410,6 +410,7 @@ UnauthorizedLecturer: You are no administrator for this course. UnauthorizedAllocationLecturer: You are no administrator for any of the courses of this central allocation. UnauthorizedCorrector: You are no sheet corrector for this course. UnauthorizedSheetCorrector: You are no corrector for this sheet. +UnauthorizedExamCorrector: You are no corrector for this exam. UnauthorizedCorrectorAny: You are no corrector for any course. UnauthorizedRegistered: You are no participant in this course. UnauthorizedAllocationRegistered: You are no participant in this central allocation. @@ -1188,6 +1189,7 @@ MenuExamEdit: Edit MenuExamUsers: Participants MenuExamGrades: Exam results MenuExamAddMembers: Add exam participants +MenuExamCorrect: Grade exams MenuExamOfficeExams: Exams MenuExamOfficeFields: Fields of study MenuExamOfficeUsers: Users @@ -1290,6 +1292,7 @@ AuthTagDeprecated: Page is not deprecated AuthTagDevelopment: Page is not in development AuthTagLecturer: User is lecturer AuthTagCorrector: User is corrector +AuthTagExamCorrector: User is exam corrector AuthTagTutor: User is tutor AuthTagTutorControl: Tutors have control over their tutorial AuthTagTime: Time restrictions are fulfilled diff --git a/records.json b/records.json index 0f908f595..c46ad95db 100644 --- a/records.json +++ b/records.json @@ -274,10 +274,12 @@ ], "modules": { "byIdentifier": { - "multi frontend/src/polyfill.js frontend/src/main.js": 0 + "multi frontend/src/polyfill.js frontend/src/main.js": 0, + "ignored node_modules/sodium-javascript crypto": 1 }, "usedIds": { - "0": 0 + "0": 0, + "1": 1 } }, "chunks": { diff --git a/src/Foundation.hs b/src/Foundation.hs index ec21097af..f2f35bc34 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -542,6 +542,8 @@ tagAccessPredicate AuthExamCorrector = APDB $ \mAuthId route _ -> case route of E.&&. course E.^. CourseSchool E.==. E.val ssh E.&&. course E.^. CourseShorthand E.==. E.val csh E.&&. exam E.^. ExamName E.==. E.val examn + guardMExceptT isCorrector $ unauthorizedI MsgUnauthorizedExamCorrector + return Authorized r -> $unsupportedAuthPredicate AuthExamCorrector r tagAccessPredicate AuthTutor = APDB $ \mAuthId route _ -> exceptT return return $ do authId <- maybeExceptT AuthenticationRequired $ return mAuthId diff --git a/src/Handler/Exam/Form.hs b/src/Handler/Exam/Form.hs index a084c209f..d0e0baf9c 100644 --- a/src/Handler/Exam/Form.hs +++ b/src/Handler/Exam/Form.hs @@ -147,7 +147,7 @@ examCorrectorsForm mPrev = wFormToAForm $ do miLayout' :: MassInputLayout ListLength (Either UserEmail UserId) () miLayout' lLength _ cellWdgts delButtons addWdgts = $(widgetFile "widgets/massinput/examCorrectors/layout") - fmap Set.fromList <$> massInputAccumW miAdd' miCell' miButtonAction' miLayout' ("correctors" :: Text) (fslI MsgExamCorrectors & setTooltip (UniWorXMessages [MsgExamCorrectorsTip, MsgMassInputTip]) False (Set.toList <$> mPrev) + fmap Set.fromList <$> massInputAccumW miAdd' miCell' miButtonAction' miLayout' ("correctors" :: Text) (fslI MsgExamCorrectors & setTooltip (UniWorXMessages [SomeMessage MsgExamCorrectorsTip, SomeMessage MsgMassInputTip])) False (Set.toList <$> mPrev) examOccurrenceForm :: Maybe (Set ExamOccurrenceForm) -> AForm Handler (Set ExamOccurrenceForm) examOccurrenceForm prev = wFormToAForm $ do diff --git a/src/Model/Types/Security.hs b/src/Model/Types/Security.hs index 65bf1259f..682cbc789 100644 --- a/src/Model/Types/Security.hs +++ b/src/Model/Types/Security.hs @@ -47,6 +47,7 @@ data AuthTag -- sortiert nach gewünschter Reihenfolge auf /authpreds, d.h. Prä = AuthAdmin | AuthLecturer | AuthCorrector + | AuthExamCorrector | AuthTutor | AuthTutorControl | AuthExamOffice