diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index 884a8c831..55c75cc7e 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -550,6 +550,7 @@ UnauthorizedWorkflowWorkflowsNotEmpty: Es gibt laufende Workflows, die Sie einse UnauthorizedWorkflowFiles: Sie dürfen die angegebenen Workflow-Dateien nicht im angegebenen historischen Zustand herunterladen UnauthorizedNotAuthenticatedInDifferentApproot: Sie konnten im Kontext einer separierten Domain (z.B. zum sicheren Download von Dateien) nicht authentifiziert werden. Vermutlich haben Sie kein oder ein abgelaufenes Token verwendet. Sie können versuchen auf die gewünschte Resource mit einem neu generierten Download-Link zuzugreifen. UnauthorizedCsrfDisabled: Ihre Anfrage hätte wmgl. Änderungen am Server-Zustand ausgelöst. Da die sog. CSRF-Protection für Ihre Anfrage deaktiviert ist, musste sie daher abgelehnt werden. +UnauthorizedStudent: Sie sind kein Student WorkflowRoleUserMismatch: Sie sind nicht einer der vom Workflow geforderten Benutzer WorkflowRoleAlreadyInitiated: Dieser Workflow wurde bereits initiiert @@ -1597,6 +1598,7 @@ AuthTagRead: Zugriff ist nur lesend AuthTagWrite: Zugriff ist i.A. schreibend AuthTagSubmissionGroup: Nutzer ist Mitglied in registrierter Abgabegruppe AuthTagWorkflow: Nutzer hat passende Workflow-Rolle +AuthTagStudent: Nutzer ist Student DeleteCopyStringIfSure n@Int: Wenn Sie sich sicher sind, dass Sie #{pluralDE n "das obige Objekt" "obige Objekte"} unwiderbringlich löschen möchten, schreiben Sie bitte zunächst den angezeigten Text ab. DeletePressButtonIfSure n@Int: Wenn Sie sich sicher sind, dass Sie #{pluralDE n "das obige Objekt" "obige Objekte"} unwiderbringlich löschen möchten, bestätigen Sie dies bitte durch Drücken des untigen Knopfes. @@ -2986,6 +2988,7 @@ CronMatchNone: Nie SystemExamOffice: Prüfungsverwaltung SystemFaculty: Fakultätsmitglied +SystemStudent: Student WorkflowScopeKindGlobal: Systemweit WorkflowScopeKindTerm: Pro Semester diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index 094d349e8..3d722ac40 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -547,6 +547,7 @@ UnauthorizedWorkflowWorkflowsNotEmpty: There are running workflows, which you ma UnauthorizedWorkflowFiles: You are not allowed to download the given workflow files in the given historical state UnauthorizedNotAuthenticatedInDifferentApproot: You could not be authenticated in the context of a separate domain (e.g. for secure downloading of files). You probably used no or an expired token. You can try to access the resource with a newly generated download link. UnauthorizedCsrfDisabled: Your request might have triggered a state change on the server. Since CSRF-protection was disabled for your request, it had to be rejected. +UnauthorizedStudent: You are not a student. WorkflowRoleUserMismatch: You aren't any of the users authorized by the workflow WorkflowRoleAlreadyInitiated: This workflow was already initiated @@ -1597,6 +1598,7 @@ AuthTagRead: Access is read only AuthTagWrite: Access might write AuthTagSubmissionGroup: User is part of a submission group AuthTagWorkflow: User has matching workflow role +AuthTagStudent: User is a student DeleteCopyStringIfSure n: If you are sure that you want to permanently delete the #{pluralEN n "object" "objects"} listed below, please copy the shown text. DeletePressButtonIfSure n: If you are sure that you want to permanently delete the #{pluralEN n "object" "objects"} listed below, please confirm the action by pressing the button. @@ -2987,6 +2989,7 @@ CronMatchNone: Never SystemExamOffice: Exam office SystemFaculty: Faculty member +SystemStudent: Student WorkflowScopeKindGlobal: Global WorkflowScopeKindTerm: Per term diff --git a/src/Foundation/Authorization.hs b/src/Foundation/Authorization.hs index 42e343c44..039fb4016 100644 --- a/src/Foundation/Authorization.hs +++ b/src/Foundation/Authorization.hs @@ -360,6 +360,11 @@ tagAccessPredicate AuthSystemExamOffice = APDB $ \_ mAuthId _ _ -> $cachedHereBi isExamOffice <- lift $ exists [UserSystemFunctionUser ==. authId, UserSystemFunctionFunction ==. SystemExamOffice, UserSystemFunctionIsOptOut ==. False] guardMExceptT isExamOffice $ unauthorizedI MsgUnauthorizedSystemExamOffice return Authorized +tagAccessPredicate AuthStudent = APDB $ \_ mAuthId _ _ -> $cachedHereBinary mAuthId . exceptT return return $ do + authId <- maybeExceptT AuthenticationRequired $ return mAuthId + isExamOffice <- lift $ exists [UserSystemFunctionUser ==. authId, UserSystemFunctionFunction ==. SystemStudent, UserSystemFunctionIsOptOut ==. False] + guardMExceptT isExamOffice $ unauthorizedI MsgUnauthorizedStudent + return Authorized tagAccessPredicate AuthExamOffice = APDB $ \_ mAuthId route _ -> case route of CExamR tid ssh csh examn _ -> $cachedHereBinary (mAuthId, tid, ssh, csh, examn) . exceptT return return $ do authId <- maybeExceptT AuthenticationRequired $ return mAuthId diff --git a/src/Handler/Utils/LdapSystemFunctions.hs b/src/Handler/Utils/LdapSystemFunctions.hs index c87b3f252..8bd2d6c97 100644 --- a/src/Handler/Utils/LdapSystemFunctions.hs +++ b/src/Handler/Utils/LdapSystemFunctions.hs @@ -11,3 +11,4 @@ determineSystemFunctions :: Set (CI Text) -> (SystemFunction -> Bool) determineSystemFunctions ldapFuncs = \case SystemExamOffice -> False SystemFaculty -> "faculty" `Set.member` ldapFuncs + SystemStudent -> "student" `Set.member` ldapFuncs diff --git a/src/Model/Types/Security.hs b/src/Model/Types/Security.hs index 94a4edca5..a7fa4d442 100644 --- a/src/Model/Types/Security.hs +++ b/src/Model/Types/Security.hs @@ -65,6 +65,7 @@ data AuthTag -- sortiert nach gewünschter Reihenfolge auf /authpreds, d.h. Prä | AuthExamResult | AuthParticipant | AuthApplicant + | AuthStudent | AuthTime | AuthStaffTime | AuthAllocationTime diff --git a/src/Model/Types/User.hs b/src/Model/Types/User.hs index 09eba6393..73745bddb 100644 --- a/src/Model/Types/User.hs +++ b/src/Model/Types/User.hs @@ -7,6 +7,7 @@ import Model.Types.TH.PathPiece data SystemFunction = SystemExamOffice | SystemFaculty + | SystemStudent deriving (Eq, Ord, Read, Show, Enum, Bounded, Generic, Typeable) deriving anyclass (Universe, Finite, Hashable, NFData)