1 ##parameters=groupId, roles=[], ajax='', REQUEST=None
3 aclu
= context
.aq_inner
.acl_users
4 prefix
= aclu
.getGroupPrefix()
5 group
= context
.portal_groups
.getGroupById(groupId
)
6 newRoles
= [role
for role
in group
.getUserRoles() if role
not in roles
]
9 prefixLen
= len(prefix
)
10 groups
= [ g
[prefixLen
:] for g
in group
.getGroups(no_recurse
= 1) ]
14 aclu
.changeUser(groupId
, groups
= groups
, roles
= newRoles
)
16 if REQUEST
is not None :
17 from ZTUtils
import make_query
as mq
18 url
= context
.portal_url()
19 red
= REQUEST
.RESPONSE
.redirect
20 return red('%s/group_data?%s' % (url
, mq(group
=groupId
, ajax
=ajax
)))