source: WAeUP_SRP/trunk/skins/waeup_directory/getWAeUPGroups.py @ 4471

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

make only visible for staff

  • Property svn:keywords set to Id
File size: 532 bytes
Line 
1## Script (Python) "getWAeUPGroups"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=key=None
8# $Id: getWAeUPGroups.py 2564 2007-11-07 10:50:54Z joachim $
9"""
10Retun the groups as an vocabulary
11
12"""
13if context.isStudent():
14    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
15
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.