diff --git a/messages/uniworx/de.msg b/messages/uniworx/de.msg index 3422067ab..9d22120e5 100644 --- a/messages/uniworx/de.msg +++ b/messages/uniworx/de.msg @@ -544,5 +544,5 @@ AuthTagRated: Korrektur ist bewertet AuthTagUserSubmissions: Abgaben erfolgen durch Kursteilnehmer AuthTagCorrectorSubmissions: Abgaben erfolgen durch Korrektoren AuthTagAuthentication: Authentifizierung erfüllt Anforderungen -AuthTagIsRead: Zugriff ist nur lesend -AuthTagIsWrite: Zugriff ist i.A. schreibend \ No newline at end of file +AuthTagRead: Zugriff ist nur lesend +AuthTagWrite: Zugriff ist i.A. schreibend \ No newline at end of file diff --git a/routes b/routes index f88db8a7c..3d3668c98 100644 --- a/routes +++ b/routes @@ -19,8 +19,8 @@ -- -- !materials -- only if course allows all materials to be free (no meaning outside of courses) -- !time -- access depends on time somehow --- !isRead -- only if it is read-only access (i.e. GET but not POST) --- !isWrite -- only if it is write access (i.e. POST only) why needed??? +-- !read -- only if it is read-only access (i.e. GET but not POST) +-- !write -- only if it is write access (i.e. POST only, included for completeness) -- -- !deprecated -- like free, but logs and gives a warning; entirely disabled in production -- !development -- like free, but only for development builds @@ -78,11 +78,11 @@ /subs SSubsR GET POST -- for lecturer only /subs/new SubmissionNewR GET POST !timeANDregisteredANDuser-submissions /subs/own SubmissionOwnR GET !free -- just redirect - /sub/#CryptoFileNameSubmission SubmissionR !correctorANDisRead: - / SubShowR GET POST !ownerANDtime !ownerANDisRead + /sub/#CryptoFileNameSubmission SubmissionR !correctorANDread: + / SubShowR GET POST !ownerANDtime !ownerANDread /archive/#{ZIPArchiveName SubmissionFileType} SubArchiveR GET !owner /assign SAssignR GET POST !lecturerANDtime - /correction CorrectionR GET POST !corrector !ownerANDisReadANDrated + /correction CorrectionR GET POST !corrector !ownerANDreadANDrated !/#SubmissionFileType/*FilePath SubDownloadR GET !owner /correctors SCorrR GET POST /pseudonym SPseudonymR GET POST !registeredANDcorrector-submissions @@ -96,7 +96,7 @@ /msgs MessageListR GET POST -/msg/#{CryptoUUIDSystemMessage} MessageR GET POST !timeANDisReadANDauthentication +/msg/#{CryptoUUIDSystemMessage} MessageR GET POST !timeANDreadANDauthentication !/#UUID CryptoUUIDDispatchR GET !free -- just redirect diff --git a/src/Foundation.hs b/src/Foundation.hs index 1424bb13d..eeb86d21c 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -518,8 +518,8 @@ tagAccessPredicate AuthAuthentication = APDB $ \route _ -> case route of guard $ not systemMessageAuthenticatedOnly || isAuthenticated return Authorized r -> $unsupportedAuthPredicate "authentication" r -tagAccessPredicate AuthIsRead = APHandler . const $ bool (return Authorized) (unauthorizedI MsgUnauthorizedWrite) -tagAccessPredicate AuthIsWrite = APHandler . const $ bool (unauthorizedI MsgUnauthorized) (return Authorized) +tagAccessPredicate AuthRead = APHandler . const $ bool (return Authorized) (unauthorizedI MsgUnauthorizedWrite) +tagAccessPredicate AuthWrite = APHandler . const $ bool (unauthorizedI MsgUnauthorized) (return Authorized) newtype InvalidAuthTag = InvalidAuthTag Text diff --git a/src/Model/Types.hs b/src/Model/Types.hs index 6872daf9c..b8d18bd8e 100644 --- a/src/Model/Types.hs +++ b/src/Model/Types.hs @@ -660,8 +660,8 @@ data AuthTag | AuthUserSubmissions | AuthCorrectorSubmissions | AuthAuthentication - | AuthIsRead - | AuthIsWrite + | AuthRead + | AuthWrite deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic) instance Universe AuthTag