[Zope-Checkins] CVS: Zope/lib/python/AccessControl - SecurityManager.py:1.4.32.2

Matthew T. Kromer matt@zope.com
Mon, 1 Oct 2001 17:08:26 -0400


Update of /cvs-repository/Zope/lib/python/AccessControl
In directory cvs.zope.org:/tmp/cvs-serv27775/AccessControl

Modified Files:
      Tag: Zope-2_4-branch
	SecurityManager.py 
Log Message:
Add minor DTML accelerator, DTMLValidate is the same as the normal
SecurityManger's validate except it can be called by DTML without having to
remap the arguments.  Discovered as a minor performance improvement for
a media client in NYC.


=== Zope/lib/python/AccessControl/SecurityManager.py 1.4.32.1 => 1.4.32.2 ===
                                self._context, roles)
 
+    def DTMLValidate(self, accessed=None, container=None, name=None,
+                    value=None,md=None):
+
+        """Validate access.
+        * THIS EXISTS FOR DTML COMPATIBILITY *
+
+        Arguments:
+        
+        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 retrieved though the access.
+
+        md -- multidict for DTML (ignored)
+
+        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.
+
+        """
+        policy=self._policy
+        if policy is None: policy=_defaultPolicy
+        return policy.validate(accessed, container, name, value,
+                               self._context, _noroles)
+
     def validateValue(self, value, roles=_noroles):
         """Convenience for common case of simple value validation.
         """