Commit 5ec51bc1 authored by Hanno Schlichting's avatar Hanno Schlichting

Stop using the Products packages as a data container for __ac_permissions__

parent 531882a5
......@@ -25,10 +25,6 @@ AccessControl
* OFS - as a base class for User.BaseUserFolder
* Products (in registerPermissions using it as a data container for
``__ac_permissions__``) - this should use a global inside the module
inside AccessControl.
* App (MessageDialog, DTMLFile, ...) - all need to go - redoing the UI is
hard. We probably need to move it into some other core part of Zope2, like
the App package, which could serve as a general dumping ground for ZMI
......
......@@ -139,11 +139,11 @@ class Permission:
_registeredPermissions = {}
_ac_permissions = ()
def getPermissions():
import Products
return getattr(Products, '__ac_permissions__', ())
return _ac_permissions
def addPermission(perm, default_roles=('Manager', )):
......@@ -151,9 +151,8 @@ def addPermission(perm, default_roles=('Manager', )):
return
entry = ((perm, (), default_roles), )
import Products
Products_permissions = getPermissions()
Products.__ac_permissions__ = Products_permissions + entry
global _ac_permissions
_ac_permissions = _ac_permissions + entry
_registeredPermissions[perm] = 1
mangled = pname(perm) # get mangled permission name
if not hasattr(ApplicationDefaultPermissions, mangled):
......
......@@ -600,7 +600,6 @@ class RoleManager(Base, RoleManager):
smallRolesWidget=selectedRoles=aclAChecked=aclPChecked=aclEChecked=''
validRoles=valid_roles
#manage_rolesForm=manage_access
def manage_editRoles(self, REQUEST, acl_type='A', acl_roles=[]):
pass
......@@ -609,16 +608,15 @@ class RoleManager(Base, RoleManager):
pass
def possible_permissions(self):
d={}
Products_permissions = getPermissions()
for p in Products_permissions:
d[p[0]]=1
d = {}
permissions = getPermissions()
for p in permissions:
d[p[0]] = 1
for p in self.ac_inherited_permissions(1):
d[p[0]]=1
d[p[0]] = 1
d=d.keys()
d = d.keys()
d.sort()
return d
InitializeClass(RoleManager)
......
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