[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/Grants - AnnotationPrincipalRoleManager.py:1.3 AnnotationRolePermissionManager.py:1.4
Jim Fulton
jim@zope.com
Tue, 2 Jul 2002 15:49:09 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/Grants
In directory cvs.zope.org:/tmp/cvs-serv3863/lib/python/Zope/App/Security/Grants
Modified Files:
AnnotationPrincipalRoleManager.py
AnnotationRolePermissionManager.py
Log Message:
Added a utility function in the ZopeSecurityPolicy module to get the
permissions held by a principal. This is needed to implement the
granting policy described in
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3SecurityModel
Also removed the special security settings "Assign" and "Remove" and
switched code to the "Allow" and "Deny" instead.
=== Zope3/lib/python/Zope/App/Security/Grants/AnnotationPrincipalRoleManager.py 1.2 => 1.3 ===
from Zope.App.Security.Grants.PersistentLocalSecurityMap import \
PersistentLocalSecurityMap
-from Zope.App.Security.Settings import Assign, Remove, Unset
+from Zope.App.Security.Settings import Allow, Deny, Unset
annotation_key = 'Zope.App.Security.AnnotationPrincipalRoleManager'
@@ -34,12 +34,12 @@
def assignRoleToPrincipal(self, role_id, principal_id):
''' See the interface IPrincipalRoleManager '''
pp = self._getPrincipalRoles(create=1)
- pp.addCell(role_id, principal_id, Assign)
+ pp.addCell(role_id, principal_id, Allow)
def removeRoleFromPrincipal(self, role_id, principal_id):
''' See the interface IPrincipalRoleManager '''
pp = self._getPrincipalRoles(create=1)
- pp.addCell(role_id, principal_id, Remove)
+ pp.addCell(role_id, principal_id, Deny)
def unsetRoleForPrincipal(self, role_id, principal_id):
''' See the interface IPrincipalRoleManager '''
=== Zope3/lib/python/Zope/App/Security/Grants/AnnotationRolePermissionManager.py 1.3 => 1.4 ===
rp = self._getRolePermissions()
if rp:
- return rp.getAllCells(role_id)
+ return rp.getAllCells()
else:
return []