[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - SecurityManager.py:1.1.2.2
Chris McDonough
chrism@zope.com
Fri, 30 Nov 2001 16:31:29 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv16039
Modified Files:
Tag: Zope-3x-branch
SecurityManager.py
Log Message:
Changed interface methods to accept only name and value.
=== Zope3/lib/python/Zope/App/Security/SecurityManager.py 1.1.2.1 => 1.1.2.2 ===
self._policy = None
- def validate( self, accessed, container, name, value, roles ):
+ def validate( self, name, value ):
"""
Validate access.
Arguments:
- accessed -- the object that was being accessed
-
- container -- the object the value was found in
-
name -- The attribute name used to access the value
value -- The value retrieved though the access.
- roles -- an (optional) list of roles to use when authorizing
- access
-
- The arguments may be provided as keyword arguments. Some of
- these arguments may be ommitted, however, the policy may
- reject access in some cases when arguments are ommitted.
- It is best to provide all the values possible.
-
A boolean value is returned indicating whether the value is
accessible. An Unauthorized exception may be raised in some
cases.
"""
policy = self._policy
if policy is None: policy = _defaultPolicy
- return policy.validate( accessed, container, name, value,
- self._context, roles )
+ return policy.validate( name, value, self._context )
def validateValue( self, value, roles ):
"""
@@ -83,7 +70,7 @@
policy = self._policy
if policy is None:
policy = _defaultPolicy
- return policy.validate( None, None, None, value, self._context, roles )
+ return policy.validate( None, value, self._context )
def checkPermission( self, permission, object ):
"""