Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Aug 9, 2024
1 parent 34e58d1 commit 3691fe5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dsp_permissions_scripts/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from dsp_permissions_scripts.doap.doap_set import apply_updated_doaps_on_server
from dsp_permissions_scripts.models import group
from dsp_permissions_scripts.models.host import Hosts
from dsp_permissions_scripts.models.scope import PUBLIC
from dsp_permissions_scripts.models.scope import PUBLIC, PermissionScope
from dsp_permissions_scripts.oap.oap_get import get_all_oaps_of_project
from dsp_permissions_scripts.oap.oap_model import Oap
from dsp_permissions_scripts.oap.oap_model import OapRetrieveConfig
Expand Down Expand Up @@ -77,6 +77,12 @@ def update_aps(host: str, shortcode: str, dsp_client: DspClient) -> None:
existing_aps=project_aps,
forGroup=group.UNKNOWN_USER,
dsp_client=dsp_client,
)
_ = create_new_ap_on_server( # noqa: F821
forGroup=group.CREATOR,
shortcode=shortcode,
hasPermissions=frozenset({ApValue.ProjectResourceCreateAllPermission}),
dsp_client=dsp_client,
)
modified_aps = modify_aps(remaining_aps)
if not modified_aps:
Expand All @@ -100,6 +106,12 @@ def update_doaps(host: str, shortcode: str, dsp_client: DspClient) -> None:
shortcode=shortcode,
mode="original",
host=host,
)
_ = create_new_doap_on_server( # noqa: F821
target=group.CREATOR, # solve this differently: it should be a DoapTarget, but the project IRI is not known yet. it could be for a group, for a class, or a property
shortcode=shortcode,
scope=PermissionScope(),
dsp_client=dsp_client,
)
project_doaps_modified = modify_doaps(doaps=project_doaps)
if not project_doaps_modified:
Expand Down

0 comments on commit 3691fe5

Please sign in to comment.