[ZCM] [ZC] 236/ 3 Resolve "Owned.changeOwnership buggy ?"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Fri, 08 Mar 2002 11:10:24 -0500


Issue #236 Update (Resolve) "Owned.changeOwnership buggy ?"
 Status Resolved, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/236

==============================================================
= Resolve - Entry #3 by Brian on Mar 8, 2002 11:10 am

 Status: Pending => Resolved

This has been fixed for 2.5.1 / 2.4.4. 
________________________________________
= Comment - Entry #2 by gillou on Feb 20, 2002 4:35 pm

Jerôme Alet gently replyed in zope@zope.org he already noticed this behavior in former Zope releases.

http://zope.nipltd.com/public/lists/zope-archive.nsf/47ba74c812dbc5dd8025687f0024bb5f/1253144daa5a47e280256ae7003c96cd?OpenDocument&Highlight=2,jerome,patch

http://zope.nipltd.com/public/lists/zope-archive.nsf/47ba74c812dbc5dd8025687f0024bb5f/124aa6e6063c68c180256ac6005913e9?OpenDocument&Highlight=2,jerome,patch
________________________________________
= Request - Entry #1 by gillou on Feb 20, 2002 4:31 pm

Hi,

When trying to give (with an externat method) an authentified user the ownership of a folder and - recursively - its content, I noticed that when that folder is already owned by that user, the somefolder.changeOwnership(someuser, recursive=1) did not work on objects contained in that folder (always owned by the former owner).

When reading the source (lib/python/AccessControl/Owned.py), I noticed this (lines 106...108) in changeOwnership():

        old=aq_get(self, '_owner', None, 1)
        if old==new: return
        if old is UnownableOwner: return

Means that if the new owner is the former owner, changeOwnership stops immediately, even if recursive=1.
So I commented out line 107 (# if old==new: return) and it works. I mean the owner of the folder is changed as well as the contained objects, like stated in the method's docstring, whatever's the current folder owner.


==============================================================