[Zope-Checkins] SVN: Zope/branches/2.11/ Move 'ApplicationDefaultPermissiosn' from 'App.class_init' to 'AccessControl.Permissions'.
Tres Seaver
tseaver at palladion.com
Fri Jan 2 13:20:03 EST 2009
Log message for revision 94455:
Move 'ApplicationDefaultPermissiosn' from 'App.class_init' to 'AccessControl.Permissions'.
o This move breaks an import cycle in third-party code which avoids imports
from 'Globals.'
o Leave the class importable from its old location without deprecation.
Changed:
U Zope/branches/2.11/doc/CHANGES.txt
U Zope/branches/2.11/lib/python/AccessControl/Permission.py
U Zope/branches/2.11/lib/python/App/class_init.py
-=-
Modified: Zope/branches/2.11/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.11/doc/CHANGES.txt 2009-01-02 18:14:05 UTC (rev 94454)
+++ Zope/branches/2.11/doc/CHANGES.txt 2009-01-02 18:20:03 UTC (rev 94455)
@@ -6,6 +6,13 @@
Zope 2.11.3 (unreleased)
+ Restructuring
+
+ - Moved 'ApplicationDefaultPermissiosn' from 'App.class_init' to
+ 'AccessControl.Permissions', in order to break an import cycle
+ in third-party code which avoids imports from 'Globals.' Left
+ the class importable from its old location without deprecation.
+
Bugs Fixed
- Products.PluginIndexes.PathIndex: backported doc fixes /
Modified: Zope/branches/2.11/lib/python/AccessControl/Permission.py
===================================================================
--- Zope/branches/2.11/lib/python/AccessControl/Permission.py 2009-01-02 18:14:05 UTC (rev 94454)
+++ Zope/branches/2.11/lib/python/AccessControl/Permission.py 2009-01-02 18:20:03 UTC (rev 94455)
@@ -136,3 +136,7 @@
if not hasattr(Globals.ApplicationDefaultPermissions, mangled):
setattr(Globals.ApplicationDefaultPermissions,
mangled, default)
+
+class ApplicationDefaultPermissions:
+ _View_Permission = ('Manager', 'Anonymous')
+ _Access_contents_information_Permission = ('Manager', 'Anonymous')
Modified: Zope/branches/2.11/lib/python/App/class_init.py
===================================================================
--- Zope/branches/2.11/lib/python/App/class_init.py 2009-01-02 18:14:05 UTC (rev 94454)
+++ Zope/branches/2.11/lib/python/App/class_init.py 2009-01-02 18:20:03 UTC (rev 94455)
@@ -12,14 +12,12 @@
##############################################################################
import logging
+
+from AccessControl.Permission import ApplicationDefaultPermissions # BBB
+from AccessControl.Permission import registerPermissions
from AccessControl.PermissionRole import PermissionRole
-import AccessControl.Permission
-class ApplicationDefaultPermissions:
- _View_Permission='Manager', 'Anonymous'
- _Access_contents_information_Permission='Manager', 'Anonymous'
-
def default__class_init__(self):
dict=self.__dict__
have=dict.has_key
@@ -66,7 +64,7 @@
break
if self.__dict__.has_key('__ac_permissions__'):
- AccessControl.Permission.registerPermissions(self.__ac_permissions__)
+ registerPermissions(self.__ac_permissions__)
for acp in self.__ac_permissions__:
pname, mnames = acp[:2]
if len(acp) > 2:
More information about the Zope-Checkins
mailing list