mirror of
https://github.com/kakwa/ldapcherry
synced 2025-07-04 12:27:47 +02:00
add methods for class Roles + unit tests
* adding get_allroles (list all available roles) * adding get_display_name (get display name of a role) * add various unit tests
This commit is contained in:
parent
6949cc71e4
commit
1211ab431b
3 changed files with 45 additions and 0 deletions
|
@ -198,6 +198,16 @@ class Roles:
|
|||
ret['unusedgroups'] = unusedgroups
|
||||
return ret
|
||||
|
||||
def get_allroles(self):
|
||||
"""get the list of roles"""
|
||||
return self.roles_raw.keys()
|
||||
|
||||
def get_display_name(self, role):
|
||||
"""get the display name of a role"""
|
||||
if not role in self.roles_raw:
|
||||
raise MissingRole(role)
|
||||
return self.roles_raw[role]['display_name']
|
||||
|
||||
def get_groups(self, role):
|
||||
"""get the list of groups from role"""
|
||||
if not role in self.roles_raw:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue