[ZCM] [ZC] 236/ 1 Request "Owned.changeOwnership buggy ?"
Collector: Zope Bugs and Patches ...
zope-coders@zope.org
Wed, 20 Feb 2002 16:31:15 -0500
Issue #236 Update (Request) "Owned.changeOwnership buggy ?"
Status Pending, Zope/bug medium
To followup, visit:
http://collector.zope.org/Zope/236
==============================================================
= 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.
==============================================================