perf: 优化授权规则获取用户授权的账号API

This commit is contained in:
Jiangjie.Bai
2022-11-16 11:29:02 +08:00
parent aa9e5d2432
commit e118ed655b
7 changed files with 33 additions and 64 deletions

View File

@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
from common.db.fields import BitChoices
from common.utils.integer import bit
__all__ = ["SpecialAccount", "ActionChoices"]
__all__ = ["ActionChoices"]
class ActionChoices(BitChoices):
@@ -31,7 +31,3 @@ class ActionChoices(BitChoices):
def has_perm(cls, action_name, total):
action_value = getattr(cls, action_name)
return action_value & total == action_value
class SpecialAccount(models.TextChoices):
ALL = "@ALL", "All"