[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ Seems some of these functions have persistent references to them in a standard install, so we better leave them in place.

Hanno Schlichting plone at hannosch.info
Fri Jan 23 13:51:41 EST 2009


Log message for revision 94965:
  Seems some of these functions have persistent references to them in a standard install, so we better leave them in place.
  

Changed:
  U   Zope/trunk/lib/python/AccessControl/PermissionMapping.py
  U   Zope/trunk/lib/python/AccessControl/Role.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/PermissionMapping.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/PermissionMapping.py	2009-01-23 18:32:02 UTC (rev 94964)
+++ Zope/trunk/lib/python/AccessControl/PermissionMapping.py	2009-01-23 18:51:41 UTC (rev 94965)
@@ -91,6 +91,19 @@
                 REQUEST,
                 manage_tabs_message='The permission mapping has been updated')
 
+    def _isBeingUsedAsAMethod(self, REQUEST =None, wannaBe=0):
+        try:
+            if hasattr(self, 'aq_self'):
+                r=self.aq_acquire('_isBeingUsedAsAMethod_')
+            else:
+                r=self._isBeingUsedAsAMethod_
+        except: r=0
+
+        if REQUEST is not None:
+            if not r != (not wannaBe): REQUEST.response.notFoundError()
+
+        return r
+
 InitializeClass(RoleManager)
 
 

Modified: Zope/trunk/lib/python/AccessControl/Role.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/Role.py	2009-01-23 18:32:02 UTC (rev 94964)
+++ Zope/trunk/lib/python/AccessControl/Role.py	2009-01-23 18:51:41 UTC (rev 94965)
@@ -18,6 +18,7 @@
 
 from Acquisition import Acquired
 from Acquisition import aq_base
+from Acquisition import aq_get
 from AccessControl import ClassSecurityInfo
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.Permissions import change_permissions
@@ -34,7 +35,13 @@
 
 DEFAULTMAXLISTUSERS=250
 
+def _isBeingUsedAsAMethod(self):
+    return aq_get(self, '_isBeingUsedAsAMethod_', 0)
 
+def _isNotBeingUsedAsAMethod(self):
+    return not aq_get(self, '_isBeingUsedAsAMethod_', 0)
+
+
 class RoleManager(Base, RoleManager):
 
     """An object that has configurable permissions"""



More information about the Zope-Checkins mailing list