SV: Subject: [Zope-dev] change ownership

2001-05-10 Thread Magnus Heino (Rivermen)


The one that comes with Zope.

/Magnus

> -Ursprungligt meddelande-
> Från: Tim McLaughlin [mailto:[EMAIL PROTECTED]]
> Skickat: den 10 maj 2001 15:26
> Till: 'Magnus Heino (Rivermen)'; Tim McLaughlin
> Kopia: '[EMAIL PROTECTED]'
> Ämne: RE: Subject: [Zope-dev] change ownership
> 
> 
> What kind of UserFolder are you using... LoginManager or something?
> 
> -Original Message-
> From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 9:13 AM
> To: 'Tim McLaughlin'; Magnus Heino (Rivermen)
> Cc: '[EMAIL PROTECTED]'
> 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: ((, '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)
> 

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



SV: Subject: [Zope-dev] change ownership

2001-05-10 Thread Magnus Heino (Rivermen)


> 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/ExternalMethod/Exter
nalMethod.py, line 262, in __call__
(Object: setObjectOwner)
(Info: ((, '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/Owned.py, line
168, in changeOwnership
(Object: PLATS_1)
  File
/usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/Owned.py, line
302, in ownerInfo
AttributeError: (see above)


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



SV: Subject: [Zope-dev] change ownership

2001-05-10 Thread Magnus Heino (Rivermen)


I can get it to work :-/

I get an attributeerror on aq_inner in lib/python/AccessControl/Owned.py,
line 302, in ownerInfo

Seems as if the user i provide isn't of the right type?

How do you use your method? How is it being called?

/Magnus

> Magnus,
> No, changeOwnership is not exposed for TTW calling.  But you 
> can expose it
> through an external method...  I used this one on a ZClass.
> 
> def set_owner(self, user):
> self.changeOwnership(user)
> return

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )