[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - ZopeSecurityPolicy.py:1.1.2.5
Chris McDonough
chrism@zope.com
Fri, 30 Nov 2001 16:30:50 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv15966
Modified Files:
Tag: Zope-3x-branch
ZopeSecurityPolicy.py
Log Message:
Changed interface methods to accept only value and name.
=== Zope3/lib/python/Zope/App/Security/ZopeSecurityPolicy.py 1.1.2.4 => 1.1.2.5 ===
#
def validate( self
- , accessed
- , container
, name
, value
, context
):
- """
- Return silently if current user (from 'context') is allowed
- to access 'value' from 'accessed'; else raise Unauthorized.
-
- accessed -- the object that was being accessed
-
- container -- the object the value was found in
-
- name -- The name used to access the value
-
- value -- The value returned by the access
-
- context -- must implement ISecurityContext; access to information
- such as the context stack and AUTHENTICATED_USER.
- """
if not self.allowName( name ):
raise Unauthorized, "Name '%s' is not allowed" % name
@@ -109,19 +92,6 @@
)
def checkPermission( self, permission, object, context ):
- """
- Check whether the security context allows the given
- permission on the given object.
-
- Arguments:
-
- permission -- A permission name
-
- object -- The object being accessed according to the permission
-
- context -- A SecurityContext, which provides access to information
- shuch as the context stack and AUTHENTICATED_USER.
- """
roles = self._aggregateRolesFor( permission, object )
return context.user.allowed( object, roles )