Skip to content

Commit

Permalink
fix: remove inexisting ProjectAdminOntologyAllPermission (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Oct 13, 2023
1 parent 49c575f commit 7791772
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions dsp_permissions_scripts/ap/ap_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class ApValue(Enum):
ProjectAdminGroupRestrictedPermission = "ProjectAdminGroupRestrictedPermission"
# is allowed to change the permissions on all objects belonging to the project
ProjectAdminRightsAllPermission = "ProjectAdminRightsAllPermission"
# is allowed to administrate the project ontologies
ProjectAdminOntologyAllPermission = "ProjectAdminOntologyAllPermission"


class Ap(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions dsp_permissions_scripts/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def modify_aps(aps: list[Ap]) -> list[Ap]:
modified_aps = []
for ap in aps:
if ap.forGroup == builtin_groups.PROJECT_MEMBER:
if ApValue.ProjectAdminOntologyAllPermission not in ap.hasPermissions:
ap.add_permission(ApValue.ProjectAdminOntologyAllPermission)
if ApValue.ProjectAdminGroupAllPermission not in ap.hasPermissions:
ap.add_permission(ApValue.ProjectAdminGroupAllPermission)
modified_aps.append(ap)
return modified_aps

Expand Down
2 changes: 1 addition & 1 deletion tests/test_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def test_remove_permission(self):

def test_remove_permission_not_exists(self):
with self.assertRaises(ValueError):
self.ap.remove_permission(ApValue.ProjectAdminOntologyAllPermission)
self.ap.remove_permission(ApValue.ProjectAdminAllPermission)

0 comments on commit 7791772

Please sign in to comment.