Skip to content
Snippets Groups Projects
Commit 27fbb2b8 authored by florian's avatar florian
Browse files

DOC: Add some explanatory comments to curator permissions script

parent 74e8f71f
No related branches found
No related tags found
Loading
...@@ -74,12 +74,16 @@ def main(): ...@@ -74,12 +74,16 @@ def main():
"USE:*", "USE:*",
] ]
# Iterate over all entities defined in the schemas and update their access control list (ACL) accordingly.
updates = db.Container() updates = db.Container()
for model in [dataspace_definitions, dataset_definitions]: for model in [dataspace_definitions, dataset_definitions]:
for ent in model.values(): for ent in model.values():
if ent.name in [u.name for u in updates]: if ent.name in [u.name for u in updates]:
# Skip entities that have been updated already
continue continue
# The entity needs to be retrieved with the ACL flag to update the
# ACL down the road
ent.retrieve(flags={"ACL": None}) ent.retrieve(flags={"ACL": None})
for d in core_model_deny_permissions: for d in core_model_deny_permissions:
ent.deny(role=CURATOR, priority=True, permission=d) ent.deny(role=CURATOR, priority=True, permission=d)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment