Skip to content

Commit

Permalink
Merge branch 'main' into wip/DEV-2784-validate-permissionscope-model
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Oct 9, 2023
2 parents 2e7fdfe + bfbf9f4 commit b50b707
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion dsp_permissions_scripts/models/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ class BuiltinGroup(Enum):
PROJECT_MEMBER = "http://www.knora.org/ontology/knora-admin#ProjectMember"
PROJECT_ADMIN = "http://www.knora.org/ontology/knora-admin#ProjectAdmin"
CREATOR = "http://www.knora.org/ontology/knora-admin#Creator"
SYSTEM_USER = "http://www.knora.org/ontology/knora-admin#SystemUser"
SYSTEM_ADMIN = "http://www.knora.org/ontology/knora-admin#SystemAdmin"
8 changes: 4 additions & 4 deletions tests/test_scope_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

class TestScopeSerialization(unittest.TestCase):
perm_strings = [
"CR knora-admin:SystemUser|V knora-admin:CustomGroup",
"CR knora-admin:SystemAdmin|V knora-admin:CustomGroup",
"D knora-admin:ProjectAdmin|RV knora-admin:ProjectMember",
"M knora-admin:ProjectAdmin|V knora-admin:Creator,knora-admin:KnownUser|RV knora-admin:UnknownUser",
"CR knora-admin:SystemAdmin,knora-admin:ProjectAdmin|D knora-admin:Creator|RV knora-admin:UnknownUser",
]
admin_route_objects = [
[
{"name": "CR", "additionalInformation": "knora-admin:SystemUser", "permissionCode": None},
{"name": "CR", "additionalInformation": "knora-admin:SystemAdmin", "permissionCode": None},
{"name": "V", "additionalInformation": "knora-admin:CustomGroup", "permissionCode": None},
],
[
Expand All @@ -43,8 +43,8 @@ class TestScopeSerialization(unittest.TestCase):
]
scopes = [
PermissionScope(
CR={BuiltinGroup.SYSTEM_USER},
V={"http://www.knora.org/ontology/knora-admin#CustomGroup"},
CR=[BuiltinGroup.SYSTEM_ADMIN],
V=["http://www.knora.org/ontology/knora-admin#CustomGroup"],
),
PermissionScope(
D={BuiltinGroup.PROJECT_ADMIN},
Expand Down

0 comments on commit b50b707

Please sign in to comment.