diff --git a/brewtils/models.py b/brewtils/models.py index 032b924d..1ab0944a 100644 --- a/brewtils/models.py +++ b/brewtils/models.py @@ -1612,6 +1612,7 @@ def __init__( username, password=None, roles=None, + local_roles=None, remote_roles=None, is_remote=False, remote_user_mapping=None, @@ -1620,6 +1621,7 @@ def __init__( self.username = username self.password = password self.roles = roles or [] + self.local_roles = local_roles or [] self.remote_roles = remote_roles or [] self.is_remote = is_remote self.remote_user_mapping = remote_user_mapping or [] diff --git a/brewtils/schemas.py b/brewtils/schemas.py index 8b45a24f..6d282e73 100644 --- a/brewtils/schemas.py +++ b/brewtils/schemas.py @@ -580,6 +580,7 @@ class UserSchema(BaseSchema): username = fields.Str() password = fields.Str() roles = fields.List(fields.Str(), allow_none=True) + local_roles = fields.List(fields.Nested(RoleSchema())) remote_roles = fields.List(fields.Nested(RoleSchema())) remote_user_mapping = fields.List(fields.Nested(RemoteUserMapSchema())) is_remote = fields.Boolean(allow_none=True) diff --git a/brewtils/test/fixtures.py b/brewtils/test/fixtures.py index 09b1beb3..8be66441 100644 --- a/brewtils/test/fixtures.py +++ b/brewtils/test/fixtures.py @@ -568,6 +568,7 @@ def user_dict(role_dict, remote_user_map_dict): "username": "USERNAME", "password": "HASH", "roles": ["ADMIN_ROLE"], + "local_roles": [role_dict], "remote_roles": [role_dict], "remote_user_mapping": [remote_user_map_dict], "is_remote": False, @@ -579,6 +580,7 @@ def user_dict(role_dict, remote_user_map_dict): def bg_user(user_dict, bg_role, bg_remote_user_map): dict_copy = copy.deepcopy(user_dict) dict_copy["remote_roles"] = [bg_role] + dict_copy["local_roles"] = [bg_role] dict_copy["remote_user_mapping"] = [bg_remote_user_map] return User(**dict_copy)