Commit efc9670d authored by Tres Seaver's avatar Tres Seaver

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.
parent 1693c0d4
......@@ -6,6 +6,13 @@ Zope Changes
Zope 2.10.8 (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 /
......
......@@ -136,3 +136,7 @@ def registerPermissions(permissions, defaultDefault=('Manager',)):
if not hasattr(Globals.ApplicationDefaultPermissions, mangled):
setattr(Globals.ApplicationDefaultPermissions,
mangled, default)
class ApplicationDefaultPermissions:
_View_Permission = ('Manager', 'Anonymous')
_Access_contents_information_Permission = ('Manager', 'Anonymous')
......@@ -12,12 +12,10 @@
##############################################################################
import logging
from AccessControl.PermissionRole import PermissionRole
import AccessControl.Permission
class ApplicationDefaultPermissions:
_View_Permission='Manager', 'Anonymous'
_Access_contents_information_Permission='Manager', 'Anonymous'
from AccessControl.Permission import ApplicationDefaultPermissions # BBB
from AccessControl.Permission import registerPermissions
from AccessControl.PermissionRole import PermissionRole
def default__class_init__(self):
......@@ -66,7 +64,7 @@ def default__class_init__(self):
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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment