[Zope-dev] Listing a groups users via Python and portal_groups

Takahashi, Michael MTakahashi at oid.ucla.edu
Wed Jul 20 11:59:42 EDT 2005


Hi guys,

 

I'm trying to work on a function call using Python that will list the
users of any specified group using the function portal_groups.

 

I've been able to successfully do this the opposite way by getting the
users groups via portal_membership:

 

portal.portal_membership.getAuthenticatedMember().getGroups()

 

Which will return all groups this user is associated with.

 

So I've been testing using portal_groups with function calls similar to
this:

 

portal.portal_groups.getGroupById("staff").getUsers()

 

Where "staff" is the name of the group. This almost does what I need,
but not quite close enough because it lists all groups and all users.
Any suggestions or help is greatly appreciated!

 

Thanks,

 

Mike

 

 

 

 

Mike Takahashi
Web Developer * TEC at OID

UCLA Office of Instructional Development
mtakahashi (at) oid.ucla.edu
310.794.9371

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-dev/attachments/20050720/8b3dd6a6/attachment.htm


More information about the Zope-Dev mailing list