[Zope-dev] Changing Ownership

Andy McKay andym@ActiveState.com
Wed, 31 Jan 2001 17:23:16 -0800


I have a folder inside a user_info_folder that allows users to store data
(these fabled session snapshots of earlier posts). When I create it I want
to set the Ownership of that folder to the user. Since a user is created by
someone else (only admin can create users), the admin person is becoming the
owner. Simple I thought, in python when the object is created, set the
ownership

obj.changeOwnership(user)

where user is: user = self.acl_users.getUser(id)

The error I get back is

Error Type: AttributeError
Error Value: aq_inner


...

  File d:\Zope23\lib\python\AccessControl\Owned.py, line 168, in
changeOwnership
    (Object: Traversable)
  File d:\Zope23\lib\python\AccessControl\Owned.py, line 302, in ownerInfo
AttributeError: (see above)

It would seem ownerInfo is looking for the User context to find the path to
the object. Anyway the end result is I can't seem to set the owner. Is there
a simpler way to do this. Is getUser actually returning the wrong thing?

Cheers.
--
  Andy McKay.