[Zope] Bug in Owned/changeOwnership method ?

Gilles Lenfant glenfant@bigfoot.com
Wed, 20 Feb 2002 18:56:59 +0100


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=3D1) 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=3Daq_get(self, '_owner', None, 1)
        if old=3D=3Dnew: return
        if old is UnownableOwner: return

Means that if the new owner is the former owner, changeOwnership stops =
immediately, even if recursive=3D1.
So I commented out line 107 (# if old=3D=3Dnew: 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.

Any comment ?

Is this a bug or did I miss something ?

Ah yes, I run Zope 2.5.0

--Gilles