provide utility function to get groups the current (or a given) user belongs to: remove prefix if present
This commit is contained in:
parent
b1d70fca1d
commit
b926f6601b
1 changed files with 3 additions and 1 deletions
|
@ -134,7 +134,9 @@ def getGroupsForPrincipal(principal=None):
|
||||||
if principal is None:
|
if principal is None:
|
||||||
principal = getCurrentPrincipal()
|
principal = getCurrentPrincipal()
|
||||||
gf = getGroupsFolder()
|
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):
|
def getTrackingStorage(obj, name):
|
||||||
|
|
Loading…
Add table
Reference in a new issue