1
0
Fork 0
mirror of https://github.com/kakwa/ldapcherry synced 2025-07-04 12:27:47 +02:00

implementing displaying roles and standalone groups in modify form

This commit is contained in:
kakwa 2015-06-19 22:15:37 +02:00
parent 834b5a5152
commit 5e5e7e3c6a
4 changed files with 66 additions and 6 deletions

View file

@ -280,12 +280,14 @@ class Roles:
roles = Set([])
parentroles = Set([])
notroles = Set([])
tmp = Set([])
usedgroups = {}
unusedgroups = {}
ret = {}
# determine roles membership
for role in self.roles:
self._check_member(role, groups, notroles, roles, parentroles, usedgroups)
if self._check_member(role, groups, notroles, tmp, parentroles, usedgroups):
roles.add(role)
# determine standalone groups not matching any roles
for b in groups:
for g in groups[b]:
@ -293,6 +295,7 @@ class Roles:
if b not in unusedgroups:
unusedgroups[b] = Set([])
unusedgroups[b].add(g)
ret['roles'] = roles
ret['unusedgroups'] = unusedgroups
return ret