[Zope] determining Owner of an object?

Jonothan Farr jfarr@real.com
Thu, 23 Mar 2000 19:12:42 -0800


Here's one way. There's probably an easier one.

<dtml-in get_local_roles>
  <dtml-if "'Owner' in _['sequence-item']">
    Owner: <dtml-var sequence-key>
  </dtml-if>
<dtml-else>
  No Owner
</dtml-in>

or in Python:

def getOwner(ob):
    for userid, roles in ob.get_local_roles():
        if 'Owner' in roles:
            return userid

-jfarr

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi! I'm a signature virus.
Copy me into your .sig to join the fun!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- Original Message ----- 
From: Darran Edmundson <Darran.Edmundson@anu.edu.au>
To: zope <zope@zope.org>
Sent: Thursday, March 23, 2000 3:26 PM
Subject: [Zope] determining Owner of an object?


> A simple question, how can I determine the Owner
> of a ZClass instance (or any Zope object for that matter)?