diff --git a/security/common.py b/security/common.py index 615496c..fbb6a16 100644 --- a/security/common.py +++ b/security/common.py @@ -189,6 +189,7 @@ class WorkspaceInformation(Persistent): __name__ = u'workspace_information' propagateRolePermissions = 'workspace' + propagateParentSecurity = False allocationPredicateNames = allocationPredicateNames workspaceGroupsFolderName = workspaceGroupsFolderName diff --git a/security/interfaces.py b/security/interfaces.py index 5b325f9..ef4876e 100644 --- a/security/interfaces.py +++ b/security/interfaces.py @@ -73,3 +73,6 @@ class IWorkspaceInformation(Interface): propagateRolePermissions = Attribute('Whose role permissions should be ' 'propagated to children (workspace_informaton or parent)?') + propagateParentSecurity = Attribute('Should the security settings of ' + 'the workspace parent be propagated to children?') + diff --git a/security/setter.py b/security/setter.py index 74d67bc..2992f88 100644 --- a/security/setter.py +++ b/security/setter.py @@ -151,9 +151,11 @@ class ConceptSecuritySetter(LoopsObjectSecuritySetter): setter = ISecuritySetter(adapted(relation.second)) setter.setDefaultRolePermissions() setter.acquireRolePermissions() - setter.copyPrincipalRoles(self, revert) wi = baseObject(self.context).workspaceInformation - if wi: + if wi and not wi.propagateParentSecurity: + return + setter.copyPrincipalRoles(self, revert) + if wi: setter.copyPrincipalRoles(ISecuritySetter(wi), revert) setter.propagateSecurity(revert, updated)