source: WAeUP_SRP/base/skins/waeup_directory/getWAeUPGroups.py @ 3077

Last change on this file since 3077 was 2564, checked in by joachim, 17 years ago

make only visible for staff

  • Property svn:keywords set to Id
File size: 532 bytes
RevLine 
[2564]1## Script (Python) "getWAeUPGroups"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
[1944]7##parameters=key=None
8# $Id: getWAeUPGroups.py 2564 2007-11-07 10:50:54Z joachim $
9"""
[2564]10Retun the groups as an vocabulary
[1944]11
12"""
[2564]13if context.isStudent():
14    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
15
[1944]16groups = context.portal_directories.groups.searchEntries(group='*')
17if key is None:
18    return [(g,g) for g in groups]
19if key in groups:
20    return key
21return "unknown Group %s" % key
Note: See TracBrowser for help on using the repository browser.