Commit bdbfb2af 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 ca467ab1
...@@ -6,6 +6,13 @@ Zope Changes ...@@ -6,6 +6,13 @@ Zope Changes
Zope 2.11.3 (unreleased) 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 Bugs Fixed
- Products.PluginIndexes.PathIndex: backported doc fixes / - Products.PluginIndexes.PathIndex: backported doc fixes /
......
...@@ -136,3 +136,7 @@ def registerPermissions(permissions, defaultDefault=('Manager',)): ...@@ -136,3 +136,7 @@ def registerPermissions(permissions, defaultDefault=('Manager',)):
if not hasattr(Globals.ApplicationDefaultPermissions, mangled): if not hasattr(Globals.ApplicationDefaultPermissions, mangled):
setattr(Globals.ApplicationDefaultPermissions, setattr(Globals.ApplicationDefaultPermissions,
mangled, default) mangled, default)
class ApplicationDefaultPermissions:
_View_Permission = ('Manager', 'Anonymous')
_Access_contents_information_Permission = ('Manager', 'Anonymous')
...@@ -12,12 +12,10 @@ ...@@ -12,12 +12,10 @@
############################################################################## ##############################################################################
import logging import logging
from AccessControl.PermissionRole import PermissionRole
import AccessControl.Permission
class ApplicationDefaultPermissions: from AccessControl.Permission import ApplicationDefaultPermissions # BBB
_View_Permission='Manager', 'Anonymous' from AccessControl.Permission import registerPermissions
_Access_contents_information_Permission='Manager', 'Anonymous' from AccessControl.PermissionRole import PermissionRole
def default__class_init__(self): def default__class_init__(self):
...@@ -66,7 +64,7 @@ def default__class_init__(self): ...@@ -66,7 +64,7 @@ def default__class_init__(self):
break break
if self.__dict__.has_key('__ac_permissions__'): if self.__dict__.has_key('__ac_permissions__'):
AccessControl.Permission.registerPermissions(self.__ac_permissions__) registerPermissions(self.__ac_permissions__)
for acp in self.__ac_permissions__: for acp in self.__ac_permissions__:
pname, mnames = acp[:2] pname, mnames = acp[:2]
if len(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