[CMF-checkins] SVN: CMF/trunk/CMFCore/FSObject.py Merged -r 37358:37359 from CMF-1_5-branch into trunk

Christian 'Tiran' Heimes christian at cheimes.de
Thu Jul 21 10:00:23 EDT 2005


Log message for revision 37361:
  Merged  -r 37358:37359 from CMF-1_5-branch into trunk

Changed:
  U   CMF/trunk/CMFCore/FSObject.py

-=-
Modified: CMF/trunk/CMFCore/FSObject.py
===================================================================
--- CMF/trunk/CMFCore/FSObject.py	2005-07-21 13:59:01 UTC (rev 37360)
+++ CMF/trunk/CMFCore/FSObject.py	2005-07-21 14:00:22 UTC (rev 37361)
@@ -23,6 +23,8 @@
 from AccessControl.Permission import Permission
 from Acquisition import Implicit
 from Acquisition import aq_base
+from Acquisition import aq_inner
+from Acquisition import aq_parent
 from OFS.Cache import Cacheable
 from OFS.SimpleItem import Item
 from DateTime import DateTime
@@ -81,6 +83,7 @@
         """
 
         obj = self._createZODBClone()
+        parent = aq_parent(aq_inner(self))
 
         # Preserve cache manager associations
         cachemgr_id = self.ZCacheable_getManagerId()
@@ -102,7 +105,10 @@
             rop_info = self.rolesOfPermission(old_perm)
             roles = [x['name'] for x in rop_info if x['selected'] != '']
             try:
-                obj.manage_permission(old_perm, roles=roles, acquire=acquired)
+                # if obj is based on OFS.ObjectManager an acquisition context is
+                # required for _subobject_permissions()
+                obj.__of__(parent).manage_permission(old_perm, roles=roles,
+                                                     acquire=acquired)
             except ValueError:
                 # The permission was invalid, never mind
                 pass



More information about the CMF-checkins mailing list