Browse Source

perf: 优化rbac 迁移

pull/10796/head
ibuler 1 year ago committed by Jiangjie.Bai
parent
commit
13fc2aa73c
  1. 4
      apps/rbac/builtin.py

4
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):

Loading…
Cancel
Save