From 6f2e4e060c8e312d141195beb41a6b03ee7e9480 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Thu, 24 Nov 2022 18:42:31 +0100 Subject: [PATCH] chore(sap): remove unnecessart system function tag sap --- .../uniworx/categories/authorization/de-de-formal.msg | 1 - messages/uniworx/categories/authorization/en-eu.msg | 1 - messages/uniworx/categories/model_types/de-de-formal.msg | 3 +-- messages/uniworx/categories/model_types/en-eu.msg | 3 +-- .../categories/settings/auth_settings/de-de-formal.msg | 1 - .../uniworx/categories/settings/auth_settings/en-eu.msg | 1 - src/Foundation/Authorization.hs | 9 --------- src/Handler/Utils/LdapSystemFunctions.hs | 1 - src/Model/Types/Security.hs | 1 - src/Model/Types/User.hs | 3 +-- 10 files changed, 3 insertions(+), 21 deletions(-) diff --git a/messages/uniworx/categories/authorization/de-de-formal.msg b/messages/uniworx/categories/authorization/de-de-formal.msg index 676809a3d..15d5204e6 100644 --- a/messages/uniworx/categories/authorization/de-de-formal.msg +++ b/messages/uniworx/categories/authorization/de-de-formal.msg @@ -28,7 +28,6 @@ UnauthorizedExamExamOffice: Es existieren keine Prüfungsergebnisse für Nutzer: UnauthorizedSchoolExamOffice: Sie sind nicht mit Prüfungsverwaltung für dieses Institut beauftragt. UnauthorizedSystemExamOffice: Sie sind nicht mit systemweiter Prüfungsverwaltung beauftragt. UnauthorizedSystemPrinter: Sie sind nicht mit systemweitem Druck und Briefversand beauftragt. -UnauthorizedSystemSap: Sie sind nicht mit der systemweitem SAP Schnittstellenverwaltung beauftragt. UnauthorizedExternalExamExamOffice: Es existieren keine Prüfungsergebnisse für Nutzer:innen, für die Sie mit der Prüfungsverwaltung beauftragt sind. UnauthorizedEvaluation: Sie sind nicht mit der Kursumfragenverwaltung beauftragt. UnauthorizedAllocationAdmin: Sie sind nicht mit der Administration von Zentralanmeldungen beauftragt. diff --git a/messages/uniworx/categories/authorization/en-eu.msg b/messages/uniworx/categories/authorization/en-eu.msg index 6258809ae..79a050879 100644 --- a/messages/uniworx/categories/authorization/en-eu.msg +++ b/messages/uniworx/categories/authorization/en-eu.msg @@ -30,7 +30,6 @@ UnauthorizedExamExamOffice: You are not part of the appropriate exam office for UnauthorizedSchoolExamOffice: You are not part of an exam office for this school. UnauthorizedSystemExamOffice: You are not charged with system wide exam administration. UnauthorizedSystemPrinter: You are not charged with system wide letter printing. -UnauthorizedSystemSap: You are not charged with system wide SAP administration. UnauthorizedExternalExamExamOffice: You are not part of the appropriate exam office for any of the participants of this exam. UnauthorizedSchoolLecturer: You are no lecturer for this department. UnauthorizedLecturer: You are no administrator for this course. diff --git a/messages/uniworx/categories/model_types/de-de-formal.msg b/messages/uniworx/categories/model_types/de-de-formal.msg index be3831b8a..8d7aa361c 100644 --- a/messages/uniworx/categories/model_types/de-de-formal.msg +++ b/messages/uniworx/categories/model_types/de-de-formal.msg @@ -18,5 +18,4 @@ BothSubmissions: Abgabe direkt in Uni2work oder extern mit Pseudonym SystemExamOffice: Prüfungsverwaltung SystemFaculty: Fakultätsmitglied SystemStudent: Student:in -SystemPrinter: Drucker:in -SystemSap: SAP Verwalter:in +SystemPrinter: Drucker:in \ No newline at end of file diff --git a/messages/uniworx/categories/model_types/en-eu.msg b/messages/uniworx/categories/model_types/en-eu.msg index eafba769a..fe2c2418f 100644 --- a/messages/uniworx/categories/model_types/en-eu.msg +++ b/messages/uniworx/categories/model_types/en-eu.msg @@ -18,5 +18,4 @@ BothSubmissions: Submission either directly in Uni2work or externally via pseudo SystemExamOffice: Exam office SystemFaculty: Faculty member SystemStudent: Student -SystemPrinter: Printing staff -SystemSap: SAP Administrator \ No newline at end of file +SystemPrinter: Printing staff \ No newline at end of file diff --git a/messages/uniworx/categories/settings/auth_settings/de-de-formal.msg b/messages/uniworx/categories/settings/auth_settings/de-de-formal.msg index 2def8f846..bc0ccf58e 100644 --- a/messages/uniworx/categories/settings/auth_settings/de-de-formal.msg +++ b/messages/uniworx/categories/settings/auth_settings/de-de-formal.msg @@ -14,7 +14,6 @@ AuthTagAdmin: Nutzer:in ist Administrator:in AuthTagExamOffice: Nutzer:in ist mit Prüfungsverwaltung beauftragt AuthTagSystemExamOffice: Nutzer:in ist mit systemweiter Prüfungsverwaltung beauftragt AuthTagSystemPrinter: Nutzer:in ist mit systemweiten Druck von Briefen beauftragt -AuthTagSystemSap: Nutzer:in ist mit systemweiter SAP Schnittstellen-Administration beauftragt AuthTagEvaluation: Nutzer:in ist mit Kursumfragenverwaltung beauftragt AuthTagAllocationAdmin: Nutzer:in ist mit der Administration von Zentralanmeldungen beauftragt AuthTagToken: Nutzer:in präsentiert Authorisierungs-Token diff --git a/messages/uniworx/categories/settings/auth_settings/en-eu.msg b/messages/uniworx/categories/settings/auth_settings/en-eu.msg index 241b7dfa1..5f61881c0 100644 --- a/messages/uniworx/categories/settings/auth_settings/en-eu.msg +++ b/messages/uniworx/categories/settings/auth_settings/en-eu.msg @@ -14,7 +14,6 @@ AuthTagAdmin: User is administrator AuthTagExamOffice: User is part of an exam office AuthTagSystemExamOffice: User is charged with system wide exam administration AuthTagSystemPrinter: User is responsible for system wide letter printing -AuthTagSystemSap: User is responsible for system wide SAP interface administration AuthTagEvaluation: User is charged with course evaluation AuthTagAllocationAdmin: User is charged with administration of central allocations AuthTagToken: User is presenting an authorisation-token diff --git a/src/Foundation/Authorization.hs b/src/Foundation/Authorization.hs index e94fdefa4..e792dcbde 100644 --- a/src/Foundation/Authorization.hs +++ b/src/Foundation/Authorization.hs @@ -581,15 +581,6 @@ tagAccessPredicate AuthSystemPrinter = cacheAPSystemFunction SystemPrinter (Just isPrinter <- lift $ exists [UserSystemFunctionUser ==. authId, UserSystemFunctionFunction ==. SystemPrinter, UserSystemFunctionIsOptOut ==. False] guardMExceptT isPrinter $ unauthorizedI MsgUnauthorizedSystemPrinter return Authorized -tagAccessPredicate AuthSystemSap = cacheAPSystemFunction SystemSap (Just $ Right diffHour) $ \mAuthId' _ _ sapList -> if - | maybe True (`Set.notMember` sapList) mAuthId' -> Right $ if - | is _Nothing mAuthId' -> return AuthenticationRequired - | otherwise -> unauthorizedI MsgUnauthorizedSystemSap - | otherwise -> Left $ APDB $ \_ _ mAuthId _ _ -> $cachedHereBinary mAuthId . exceptT return return $ do - authId <- maybeExceptT AuthenticationRequired $ return mAuthId - isPrinter <- lift $ exists [UserSystemFunctionUser ==. authId, UserSystemFunctionFunction ==. SystemSap, UserSystemFunctionIsOptOut ==. False] - guardMExceptT isPrinter $ unauthorizedI MsgUnauthorizedSystemSap - return Authorized tagAccessPredicate AuthStudent = cacheAPSystemFunction SystemStudent (Just $ Right diffHour) $ \mAuthId' _ _ studentList -> if | maybe True (`Set.notMember` studentList) mAuthId' -> Right $ if | is _Nothing mAuthId' -> return AuthenticationRequired diff --git a/src/Handler/Utils/LdapSystemFunctions.hs b/src/Handler/Utils/LdapSystemFunctions.hs index 7cb61a503..ada89b1b8 100644 --- a/src/Handler/Utils/LdapSystemFunctions.hs +++ b/src/Handler/Utils/LdapSystemFunctions.hs @@ -18,4 +18,3 @@ determineSystemFunctions ldapFuncs = \case -- SJ: not sure this LDAP-specific key belongs here? SystemStudent -> False -- "student" `Set.member` ldapFuncs -- no such key identified at FraPort SystemPrinter -> False -- "department=IFM-IS2" zu viele Mitglieder - SystemSap -> False diff --git a/src/Model/Types/Security.hs b/src/Model/Types/Security.hs index e6811c8ed..1cb81cbb3 100644 --- a/src/Model/Types/Security.hs +++ b/src/Model/Types/Security.hs @@ -81,7 +81,6 @@ data AuthTag -- sortiert nach gewünschter Reihenfolge auf /authpreds, d.h. Prä | AuthExamOffice | AuthSystemExamOffice | AuthSystemPrinter - | AuthSystemSap | AuthEvaluation | AuthAllocationAdmin | AuthAllocationRegistered diff --git a/src/Model/Types/User.hs b/src/Model/Types/User.hs index d39016797..ee7fd4a20 100644 --- a/src/Model/Types/User.hs +++ b/src/Model/Types/User.hs @@ -15,8 +15,7 @@ data SystemFunction = SystemExamOffice | SystemFaculty | SystemStudent - | SystemPrinter - | SystemSap + | SystemPrinter deriving (Eq, Ord, Read, Show, Enum, Bounded, Generic, Typeable) deriving anyclass (Universe, Finite, Hashable, NFData)