[Zope-CMF] showing an item only to slected groups

Dieter Maurer dieter@handshake.de
Tue, 3 Dec 2002 21:11:41 +0100


Roel Van den Bergh writes:
 > I've build a graphical homepage in front of a CMF site.
 > 
 > Within the site a certain folder is only accessible and viewable to a group
 > using NuxUserGroups and the 'skip_unauthorized' function in CMF 1.3. That
 > works fine, only the allowed groups can view/visit the folder.
 > 
 > Now I do not want the button and text for that folder to show up on the
 > homepage.
 > 
 > I'm used to hide static content for 'Guests' with
 > 
 > <dtml-let member="portal_membership.getAuthenticatedMember()"
 >           listMembers="portal_membership.checkPermission('List portal
 > members', member)">
 > <dtml-if listMembers>
 > ...
 > </dtml-let>
 > </dtml-if>
 > 
 > But I can't figure out how to check for a certain 'Group'
Use

	portal_membership.checkPermission(permission,object)

to check whether the current user(!) has "permission" on "object".

As NUXGroups are implemented as local roles (as far as I know),
this should work when you get the correct object.


Dieter