mirror of
https://github.com/kakwa/ldapcherry
synced 2025-07-04 12:27:47 +02:00
list of roles and not a uniq role for get_groups
This commit is contained in:
parent
af5fd8eeae
commit
01de849204
2 changed files with 11 additions and 5 deletions
|
@ -307,11 +307,17 @@ class Roles:
|
|||
raise MissingRole(role)
|
||||
return self.flatten[role]['display_name']
|
||||
|
||||
def get_groups(self, role):
|
||||
def get_groups(self, roles):
|
||||
"""get the list of groups from role"""
|
||||
if not role in self.flatten:
|
||||
raise MissingRole(role)
|
||||
return self.flatten[role]['backends_groups']
|
||||
ret = {}
|
||||
for role in roles:
|
||||
if not role in self.flatten:
|
||||
raise MissingRole(role)
|
||||
for b in self.flatten[role]['backends_groups']:
|
||||
if b not in ret:
|
||||
ret[b] = []
|
||||
ret[b] = ret[b] + self.flatten[role]['backends_groups'][b]
|
||||
return ret
|
||||
|
||||
def is_admin(self, roles):
|
||||
"""determine from a list of roles if is ldapcherry administrator"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue