[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/security/fields.py Add an order argument to the configuration action to force permissions

Jim Fulton jim at zope.com
Fri Jun 4 09:48:39 EDT 2004


Log message for revision 25250:
Add an order argument to the configuration action to force permissions
to be checked last.  This is an optimiation.  Recent changs to the
utility service make utility lookup expensive after utility
definitions, as extensive caches have to be rebuilt.  We don't want to
intersperse utility lookup, done when checking permissions, with
utility definitions.



-=-
Modified: Zope3/trunk/src/zope/app/security/fields.py
===================================================================
--- Zope3/trunk/src/zope/app/security/fields.py	2004-06-04 13:19:44 UTC (rev 25249)
+++ Zope3/trunk/src/zope/app/security/fields.py	2004-06-04 13:48:39 UTC (rev 25250)
@@ -68,6 +68,14 @@
             self.context.action(
                 discriminator = None,
                 callable = checkPermission,
-                args = (None, value)
+                args = (None, value),
+
+                # Delay execution till end. This is an
+                # optimization. We don't want to intersperse utility
+                # lookup, done when checking permissions, with utility
+                # definitions. Utility lookup is expensive after
+                # utility definition, as extensive caches have to be
+                # rebuilt.                
+                order=9999999, 
                 )
         




More information about the Zope3-Checkins mailing list