Do you have multiple acl_users objects in the acquisition context of the object? Because if you do and the self.acl_users will acquire (possibly) the wrong user database. If that's not the problem, I'm gonna have to let it cook, and I'll probably come up w/ somethin' later. --Tim <plug> You could also try a ZUserFolder and use restrictedTraverse if you want. :-) </plug> -----Original Message----- From: Magnus Heino (Rivermen) [mailto:magnus.heino@rivermen.se] Sent: Thursday, May 10, 2001 9:23 AM To: 'Tim McLaughlin'; Magnus Heino (Rivermen) Cc: 'zope-dev@zope.org' Subject: SV: Subject: [Zope-dev] change ownership The one that comes with Zope. /Magnus
-----Ursprungligt meddelande----- Från: Tim McLaughlin [mailto:tim@BCSWebservices.net] Skickat: den 10 maj 2001 15:26 Till: 'Magnus Heino (Rivermen)'; Tim McLaughlin Kopia: 'zope-dev@zope.org' Ämne: RE: Subject: [Zope-dev] change ownership
What kind of UserFolder are you using... LoginManager or something?
-----Original Message----- From: Magnus Heino (Rivermen) [mailto:magnus.heino@rivermen.se] Sent: Thursday, May 10, 2001 9:13 AM To: 'Tim McLaughlin'; Magnus Heino (Rivermen) Cc: 'zope-dev@zope.org' Subject: SV: Subject: [Zope-dev] change ownership
def set_owner(self, user_name): self.changeOwnership(self.acl_users.getUser(user_name))
OK, so that should keep you busy for a while. Anyway, the
Not long enough :-P
point is that the parameter to changeOwnership is a User _object_. Good luck.
Ive got this external method in a zclass:
def setObjectOwner(self, username): self.changeOwnership(self.acl_users.getUser(username))
I call it like http://localhost:8080/myobject/setObjectOwner?username=foo and get this error:
Zope Error Zope has encountered an error while publishing this resource.
Error Type: AttributeError Error Value: aq_inner
-------------------------------------------------------------- -------------- ----
Troubleshooting Suggestions
The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page.
If the error persists please contact the site maintainer. Thank you for your patience.
Traceback (innermost last): File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: setObjectOwner) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Products/Extern alMethod/Exter nalMethod.py, line 262, in __call__ (Object: setObjectOwner) (Info: ((<FooObject instance at 873bd78>, 'david'), {}, None)) File /usr/home/magnus/www/Zope-2.3.2-src/Extensions/Owner.py, line 2, in setObjectOwner (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/O wned.py, line 168, in changeOwnership (Object: PLATS_1) File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/O wned.py, line 302, in ownerInfo AttributeError: (see above)