Skip to content

Commit

Permalink
chore: streamline processes in template.py (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Oct 12, 2023
1 parent 0d9363b commit 5e6dcd6
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions dsp_permissions_scripts/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,22 @@ def update_doaps(
shortcode=shortcode,
mode="original",
)
project_doaps_updated = modify_doaps(doaps=project_doaps)
project_doaps_modified = modify_doaps(doaps=project_doaps)
apply_updated_doaps_on_server(
doaps=project_doaps_modified,
host=host,
token=token,
)
project_doaps_updated = get_doaps_of_project(
host=host,
shortcode=shortcode,
token=token,
)
serialize_doaps_of_project(
project_doaps=project_doaps_updated,
shortcode=shortcode,
mode="modified",
)
apply_updated_doaps_on_server(
doaps=project_doaps_updated,
host=host,
token=token,
)


def update_oaps(
Expand All @@ -75,25 +80,30 @@ def update_oaps(
shortcode=shortcode,
mode="original",
)
resource_oaps_updated = modify_oaps(oaps=resource_oaps)
serialize_resource_oaps(
resource_oaps=resource_oaps_updated,
resource_oaps_modified = modify_oaps(oaps=resource_oaps)
apply_updated_oaps_on_server(
resource_oaps=resource_oaps_modified,
host=host,
token=token,
shortcode=shortcode,
mode="modified",
)
apply_updated_oaps_on_server(
resource_oaps=resource_oaps_updated,
resource_oaps_updated = get_all_resource_oaps_of_project(
shortcode=shortcode,
host=host,
token=token,
)
serialize_resource_oaps(
resource_oaps=resource_oaps_updated,
shortcode=shortcode,
mode="modified",
)


def main() -> None:
"""
The main function provides you with 2 sample functions:
one to update the Object Access Permissions of a project,
and one to update the Default Object Access Permissions of a project.
one to update the Default Object Access Permissions of a project,
and one to update the Object Access Permissions of a project.
Both must first be adapted to your needs.
"""
load_dotenv() # set login credentials from .env file as environment variables
Expand Down

0 comments on commit 5e6dcd6

Please sign in to comment.