[Zope-CMF] Object ownership
John Morton
jwm@plain.co.nz
Wed, 22 May 2002 12:25:02 +1200
On Wednesday 22 May 2002 00:18, Tres Seaver wrote:
> On Tue, 2002-05-21 at 04:01, John Morton wrote:
> > But no methods for answering the question, "Which users have the local
> > role 'Owner' for this object?".
>
> This works for roles assigned directly on the object:
>
> immediate = object.users_with_local_role( 'Owner' )
>
> Because roles can be acquired, asking that question is tougher than it
> seems; you need to troll up the hierarchy, accumulating users until
> you get to the root.
Not really a problem in my case, but I'll keep it in mind.
> > I'll have a look around these places and see what I can come up with,
> > though I think the kludge of saving the workflow actor name at object
> > creation time might do the trick
>
> The 'DublinCore.Creator' method might help, too; it returns the
> userid(s) of the users with 'Owner' local role on the content object. :)
[Slaps forehead, rolls eyes] Obviously :-)
Once again, the trick to finding your way through Zope's many APIs is the
ability to ask the right question.
Thanks,
John