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).
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