source: WAeUP_CMS/trunk/skins/WAEUP/selectMenus.py @ 4793

Last change on this file since 4793 was 15, checked in by Henrik Bettermann, 19 years ago
File size: 515 bytes
Line 
1## Script (Python) "selectMenus"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=type_name=None
8##title=
9##
10pm = context.portal_membership
11member = pm.getAuthenticatedMember()
12
13menus = context.portal_catalog(portal_type=('Menu', 'TaskMenu'))
14isAdmin = member is not None and member.has_role(('Manager', 'Staff',))
15if not isAdmin:
16    menus = [ m for m in menus if not 'admin' in m.getId ]
17return [ m.getObject() for m in menus ]
Note: See TracBrowser for help on using the repository browser.