[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/Grants/Views/Browser - PrincipalRoleView.py:1.3
Jim Fulton
jim@zope.com
Tue, 2 Jul 2002 15:49:10 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/Grants/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv3863/lib/python/Zope/App/Security/Grants/Views/Browser
Modified Files:
PrincipalRoleView.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/Views/Browser/PrincipalRoleView.py 1.2 => 1.3 ===
if setting == 'Unset':
prm.unsetRoleForPrincipal(role, principal)
- elif setting == 'Assign':
+ elif setting == 'Allow':
prm.assignRoleToPrincipal(role, principal)
- elif setting == 'Remove':
+ elif setting == 'Deny':
prm.removeRoleFromPrincipal(role, principal)
else:
raise ValueError("Incorrect setting %s" % setting)
@@ -105,6 +105,6 @@
return self._grid[(principal, role)]
def listAvailableValues(self):
- # XXX rather use Assign.getName() & co
- return ('Unset', 'Assign', 'Remove')
+ # XXX rather use Allow.getName() & co
+ return ('Unset', 'Allow', 'Deny')