[Zope] Change Ownership

Jerome Alet alet@unice.fr
Thu, 13 Sep 2001 18:04:23 +0200


On Thu, Sep 13, 2001 at 04:39:19PM +0100, Phil Harris wrote:
> This is how I do it:
> 
> def chown(self,user=''):
>  user=self.acl_users.getUserById(user)
>  self.changeOwnership(user=user,recursive=1)
>  return 'Done'
> 
> put this in as an external method and call it on the object in question
> (either singular or a collection).
> 
> http://myserver/index_html/chown?user=philh

BEWARE: AFAICT Zope doesn't change ownership correctly if you already 
own a single part of a path.

i.e. say you are the owner of /MyFolder but not of /MyFolder/SubFolder, 
and decide to call changeOwnership recursively on /MyFolder to be sure
that you own both /MyFolder and /MyFolder/SubFolder, then Zope
will do nothing and you will be stuck.

Perhaps this is corrected in 2.4+, otherwise my patch (a single line deletion)
was lost 2 times in the now defunct Collector.

hth,

Jerome Alet