Fwd: a new how-to
Racinet Georges <[email protected]> Sat, 11 Apr 2009 01:54:38 +0200
| Newsgroups | gmane.comp.web.zope.cps.devel |
|---|---|
| Message-ID | <[email protected]> |
Forgot to change sender to the list. I was saying: Begin forwarded message: > From: Racinet Georges <[email protected]> > Date: April 11, 2009 1:53:18 AM CEDT > To: Guillaume GB <[email protected]> > Subject: Re: [CPS-devel] a new how-to > > > On Apr 10, 2009, at 6:00 PM, Guillaume GB wrote: > >> Hi, I just started using both Zope and CPS and your howtos helped >> me a lot (although I'm a french speaker) through the CPSMessages >> product (I think it was not done). So now, my problem is : how to >> get the members of the current workspace? Is it possible? > > Hi Guillaume, and welcome, it's nice to see new people around ! > > Out of curiosity, what's CPSMessages supposed to do ? > > About your question: checking a role or permission for a given user > is easier than obtaining the list of those having the said role or > permisson > > For roles, there is a method on the Membership Tool > (portal_membership, this code is in CPSCore). It's called > getMergedLocalRoles and returns by default a dict whose keys are > - user ids prefixed by 'user:' or > - group ids prefixed by 'group:' > - two special keys: 'role:authenticated' (all people that can > authenticate) 'role:anonymous' (non authenticated users, ie > guests). The values are the corresponding lists of roles. > You'll need to analyze this dict, and possibly expand the groups as > lists of users (methods of 'acl_users', code in CPSUserFolder). > Beware that this step can lead to huge lists of users and is > sometimes impossible because too big for a backing ldap. > > Note that WorkspaceManager doesn't imply WorkspaceMember (for > example), even though the latter usually is a subset of permissions > of the former :-) Maybe you'll want to look for both. > > "Merged" refers to the fact that this method takes inheritance into > account. > > > Cheers, > > -- > Georges Racinet, > Zope/CPS/Plone expertise, assistance & development > http://www.racinet.fr (in french) > GPG: 0x4862FFF7 > > > > > > -- Georges Racinet, Zope/CPS/Plone expertise, assistance & development GPG: 0x4862FFF7 _______________________________________________ cps-devel mailing list http://lists.nuxeo.com/mailman/listinfo/cps-devel