[Zope-CMF] Re: .props, .properties, .metadata

Christian Heimes christian at cheimes.de
Thu Jul 21 09:08:23 EDT 2005


Jens Vagelpohl wrote:
> 
> On 20 Jul 2005, at 19:21, Florent Guillaume wrote:
> 
>> The checkin message by Jens says:
>>   CMFCore.FSPropertiesObject: Added a deprecation warning to  announce 
>> the
>>   fact that .properties files will disappear in CMF 1.7 and should be
>>   replaced with CMFCore.FSMetadata (.metadata) files.
>> (http://svn.zope.org/branches/CMF-1_5-branch/CMFCore/ 
>> FSPropertiesObject.py?rev=36843&r1=36461&r2=36843)
>>
>> So am I right in thinking that the warning was added in the wrong  place?
> 
> 
> Yes, you're right. My bad. All fixed now.

The customization of property objects is broken on Zope 2.8. 
manage_permission() breaks because 
OFS.ObjectManager._subobject_permissions() needs a context.

Index: FSObject.py
===================================================================
--- FSObject.py (revision 37338)
+++ FSObject.py (working copy)
@@ -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,8 @@
              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)
+                obj.__of__(parent).manage_permission(old_perm, roles=roles,
+                                                     acquire=acquired)
              except ValueError:
                  # The permission was invalid, never mind
                  pass






More information about the Zope-CMF mailing list