diff --git a/apps/rbac/builtin.py b/apps/rbac/builtin.py index cf80c64ab..f2dd13dae 100644 --- a/apps/rbac/builtin.py +++ b/apps/rbac/builtin.py @@ -151,7 +151,7 @@ class BuiltinRole: 'User': cls.system_user.get_role(), 'Auditor': cls.system_auditor.get_role() } - return cls.system_role_mapper[name] + return cls.system_role_mapper.get(name, cls.system_role_mapper['User']) @classmethod def get_org_role_by_old_name(cls, name): @@ -161,7 +161,7 @@ class BuiltinRole: 'User': cls.org_user.get_role(), 'Auditor': cls.org_auditor.get_role(), } - return cls.org_role_mapper[name] + return cls.org_role_mapper.get(name, cls.org_role_mapper['User']) @classmethod def sync_to_db(cls, show_msg=False):