Hi, Can someone explain for a dummy like me how I'm supposed to change the owner of an object? I always assumed it'd be on the Ownership tab, but while that shows you who the owner of an object is, it doesn't let you change it. Basically, a the object is owned by a summer student who has since left, my only option now is to re-create a user object for them with a garbled password, which is majorly sucky! cheers, Chris
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 for example. hth Phil ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: <zope@zope.org> Sent: Thursday, September 13, 2001 4:29 PM Subject: [Zope] Change Ownership
Hi,
Can someone explain for a dummy like me how I'm supposed to change the owner of an object? I always assumed it'd be on the Ownership tab, but while that shows you who the owner of an object is, it doesn't let you change it.
Basically, a the object is owned by a summer student who has since left, my only option now is to re-create a user object for them with a garbled password, which is majorly sucky!
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
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
participants (3)
-
Chris Withers -
Jerome Alet -
Phil Harris