From ffac3d5b7c379cb1edee404bd9e0a8a4a0d0c073 Mon Sep 17 00:00:00 2001 From: Johannes Nussbaum Date: Fri, 13 Oct 2023 15:48:50 +0200 Subject: [PATCH] edit --- dsp_permissions_scripts/ap/ap_model.py | 2 -- dsp_permissions_scripts/template.py | 4 ++-- tests/test_ap.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dsp_permissions_scripts/ap/ap_model.py b/dsp_permissions_scripts/ap/ap_model.py index 6bda0d6a..4918521d 100644 --- a/dsp_permissions_scripts/ap/ap_model.py +++ b/dsp_permissions_scripts/ap/ap_model.py @@ -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): diff --git a/dsp_permissions_scripts/template.py b/dsp_permissions_scripts/template.py index 13d0919b..3540eb33 100644 --- a/dsp_permissions_scripts/template.py +++ b/dsp_permissions_scripts/template.py @@ -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 diff --git a/tests/test_ap.py b/tests/test_ap.py index b23fbedd..1bb85dfe 100644 --- a/tests/test_ap.py +++ b/tests/test_ap.py @@ -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)