*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit b3465e42 authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Reuse SecretLink and AccessGrant generators

* this should help with the elimination of duplicates
parent a58964db
1 merge request!56Update record permission policy
......@@ -53,18 +53,25 @@ def IfRestrictedAllowed(then_):
return IfConfig("RDM_ALLOW_RESTRICTED_RECORDS", then_=then_, else_=[])
edit_link = SecretLinks("edit")
view_link = SecretLinks("view")
preview_link = SecretLinks("preview")
secret_links = {
"manage": [], # "manage" permissions can't be shared with links
"edit": [SecretLinks("edit")],
"view": [SecretLinks("edit"), SecretLinks("view")],
"preview": [SecretLinks("edit"), SecretLinks("preview")],
"edit": [edit_link],
"view": [edit_link, view_link],
"preview": [edit_link, preview_link],
}
manage_grant = AccessGrant("manage")
edit_grant = AccessGrant("edit")
view_grant = AccessGrant("view")
preview_grant = AccessGrant("preview")
access_grants = {
"manage": [AccessGrant("manage")],
"edit": [AccessGrant("manage"), AccessGrant("edit")],
"view": [AccessGrant("manage"), AccessGrant("edit"), AccessGrant("view")],
"preview": [AccessGrant("manage"), AccessGrant("edit"), AccessGrant("preview")],
"manage": [manage_grant],
"edit": [manage_grant, edit_grant],
"view": [manage_grant, edit_grant, view_grant],
"preview": [manage_grant, edit_grant, preview_grant],
}
shared_access = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment