provide utility function to get groups the current (or a given) user belongs to: remove prefix if present

This commit is contained in:
Helmut Merz 2013-11-24 12:13:15 +01:00
parent b1d70fca1d
commit b926f6601b

View file

@ -134,7 +134,9 @@ def getGroupsForPrincipal(principal=None):
if principal is None:
principal = getCurrentPrincipal()
gf = getGroupsFolder()
return gf.getGroupsForPrincipal(principal.id)
prefix = 'gloops.'
return [(g.startswith(prefix) and g[len(prefix):] or g)
for g in gf.getGroupsForPrincipal(principal.id)]
def getTrackingStorage(obj, name):