[Zope] How to know who an object's owner is

Casey Duncan cduncan@kaivo.com
Tue, 27 Feb 2001 12:09:52 -0700


J=E9r=F4me Loisel wrote:
>=20
> Hi!  I am trying to find a function which determines who an object's ow=
ner
> is. For example, say I want to list all items in a folder like so...
>=20
> Item_Name (owned by User_Name)
>=20
> Can anyone tell me which function to use? Thanks.
>=20
> --
> J=E9r=F4me Loisel
> L=E9vinux: GNU/Linux dans les communaut=E9s =E0 L=E9vis
>=20

Zope objects have a method called owner_info used to get ownership info
in DTML for display. In Python you can use the getOwner method of the
object.

owner_info returns a dictionary like so:

{'userCanChangeOwnershipType': 1, 'id': 'cduncan', 'explicit': 1,
'path': 'acl_users'}

So, to print the owner of an object:

<dtml-with owner_info mapping><dtml-var id></dtml-with>

or=20

<dtml-var expr=3D"owner_info()['id']">

This doesn't work very well for DTML methods though...
--=20
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>