[Checkins]
SVN: z3c.securitytool/trunk/src/z3c/securitytool/demoSetup.py
Added group2 to demoSetup.py
Daniel Blackburn
blackburnd at gmail.com
Wed May 28 14:49:23 EDT 2008
Log message for revision 87000:
Added group2 to demoSetup.py
Changed:
U z3c.securitytool/trunk/src/z3c/securitytool/demoSetup.py
-=-
Modified: z3c.securitytool/trunk/src/z3c/securitytool/demoSetup.py
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/demoSetup.py 2008-05-28 18:48:48 UTC (rev 86999)
+++ z3c.securitytool/trunk/src/z3c/securitytool/demoSetup.py 2008-05-28 18:49:23 UTC (rev 87000)
@@ -34,7 +34,7 @@
# Lets get the list of all principals on the system.
sysPrincipals = zapi.principals()
principals = [x.id for x in sysPrincipals.getPrincipals('')
- if x.id not in ['group1','randy']]
+ if x.id not in ['group1','group2','randy']]
# Here is where we begin to set the permissions for the root context level
roleManager = IPrincipalRoleManager(root)
@@ -44,12 +44,18 @@
# Here we assign the group group1 to zope.daniel and zope.randy
group1 = sysPrincipals.getPrincipal('zope.group1')
+ group2 = sysPrincipals.getPrincipal('zope.group2')
daniel = sysPrincipals.getPrincipal('zope.daniel')
randy = sysPrincipals.getPrincipal('zope.randy')
+
daniel.groups.append('zope.group1')
+ group1.groups.append('zope.group2')
+
randy.groups.append('zope.group1')
+ randy.groups.append('zope.group2')
+
roleManager.assignRoleToPrincipal('zope.Writer', 'zope.daniel')
roleManager.assignRoleToPrincipal('zope.Writer', 'zope.stephan')
@@ -83,6 +89,11 @@
permManager.denyPermissionToPrincipal('concord.CreateIssue',
group1.id)
+ permManager.grantPermissionToPrincipal('concord.DeleteIssue',
+ group2.id)
+ permManager.grantPermissionToPrincipal('concord.CreateIssue',
+ group2.id)
+
# Here is where we begin to set the permissions for the context level of
# /root/Folder1/Folder2.
roleManager = IPrincipalRoleManager(root['Folder1']['Folder2'])
More information about the Checkins
mailing list