Commit c6d3da6f authored by Tres Seaver's avatar Tres Seaver

Launchpad #245649: the Products package is now a proper "namespace package".

parent 9281f548
...@@ -8,6 +8,9 @@ Zope Changes ...@@ -8,6 +8,9 @@ Zope Changes
Bugs Fixed Bugs Fixed
- Launchpad #245649: the Products package is now a proper
"namespace package" under the rules specified by setuptools.
- zope.viewlets: updated to 3.4.2 - zope.viewlets: updated to 3.4.2
- zope.sendmail: updated to 3.5.0 (fixing Launchpad #230831) - zope.sendmail: updated to 3.5.0 (fixing Launchpad #230831)
......
...@@ -129,8 +129,9 @@ def registerPermissions(permissions, defaultDefault=('Manager',)): ...@@ -129,8 +129,9 @@ def registerPermissions(permissions, defaultDefault=('Manager',)):
else: else:
perm, methods, default = setting perm, methods, default = setting
_registeredPermissions[perm]=1 _registeredPermissions[perm]=1
Products_permissions = getattr(Products, '__ac_permissions__', ())
Products.__ac_permissions__=( Products.__ac_permissions__=(
Products.__ac_permissions__+((perm,(),default),)) Products_permissions + ((perm, (), default),))
mangled=pname(perm) # get mangled permission name mangled=pname(perm) # get mangled permission name
if not hasattr(Globals.ApplicationDefaultPermissions, mangled): if not hasattr(Globals.ApplicationDefaultPermissions, mangled):
setattr(Globals.ApplicationDefaultPermissions, setattr(Globals.ApplicationDefaultPermissions,
......
...@@ -255,7 +255,8 @@ class ObjectManager( ...@@ -255,7 +255,8 @@ class ObjectManager(
return meta_types return meta_types
def _subobject_permissions(self): def _subobject_permissions(self):
return (Products.__ac_permissions__+ Products_permissions = getattr(Products, '__ac_permissions__', ())
return (Products_permissions +
self.aq_acquire('_getProductRegistryData')('ac_permissions') self.aq_acquire('_getProductRegistryData')('ac_permissions')
) )
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
__ac_permissions__=()
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages # See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try: try:
__import__('pkg_resources').declare_namespace(__name__) __import__('pkg_resources').declare_namespace(__name__)
......
...@@ -189,9 +189,10 @@ class ZClassPermissionsSheet(OFS.PropertySheets.PropertySheet, ...@@ -189,9 +189,10 @@ class ZClassPermissionsSheet(OFS.PropertySheets.PropertySheet,
manage=Globals.DTMLFile('dtml/classPermissions', globals()) manage=Globals.DTMLFile('dtml/classPermissions', globals())
def possible_permissions(self): def possible_permissions(self):
Products_permissions = getattr(Products, '__ac_permissions__', ())
r=map( r=map(
lambda p: p[0], lambda p: p[0],
Products.__ac_permissions__+ Products_permissions +
self.aq_acquire('_getProductRegistryData')('ac_permissions') self.aq_acquire('_getProductRegistryData')('ac_permissions')
) )
r.sort() r.sort()
...@@ -199,9 +200,10 @@ class ZClassPermissionsSheet(OFS.PropertySheets.PropertySheet, ...@@ -199,9 +200,10 @@ class ZClassPermissionsSheet(OFS.PropertySheets.PropertySheet,
def manage_edit(self, selected=[], REQUEST=None): def manage_edit(self, selected=[], REQUEST=None):
"Remove some permissions" "Remove some permissions"
Products_permissions = getattr(Products, '__ac_permissions__', ())
r=[] r=[]
for p in ( for p in (
Products.__ac_permissions__+ Products_permissions +
self.aq_acquire('_getProductRegistryData')('ac_permissions')): self.aq_acquire('_getProductRegistryData')('ac_permissions')):
if p[0] in selected: if p[0] in selected:
r.append(p) r.append(p)
......
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