perf: 优化 role bingding,优化 is_superuser

This commit is contained in:
ibuler
2022-03-21 16:40:14 +08:00
committed by Jiangjie.Bai
parent 3345456dc2
commit 87c6eec619
4 changed files with 110 additions and 25 deletions

View File

@@ -118,6 +118,9 @@ class Role(JMSModel):
return self.name
return gettext(self.name)
def is_org(self):
return self.scope == const.Scope.org
class SystemRole(Role):
objects = SystemRoleManager()