root: export user roles in the ws /user
This commit is contained in:
parent
76112e0f97
commit
b1cb4aa3dd
|
@ -276,6 +276,9 @@ class RootDirectory(Directory):
|
|||
return errors.AccessForbiddenError()
|
||||
user_info = user.get_substitution_variables(prefix='')
|
||||
del user_info['user']
|
||||
user_info['user_roles'] = []
|
||||
for role_id in user.roles or []:
|
||||
user_info['user_roles'].append(Role.get(role_id).name)
|
||||
return json.dumps(user_info)
|
||||
|
||||
def roles(self):
|
||||
|
|
Loading…
Reference in New Issue