pref: 修改 perm token

This commit is contained in:
ibuler
2022-11-14 14:44:18 +08:00
parent 4f135bc349
commit 8e1312e8ce
5 changed files with 32 additions and 12 deletions

View File

@@ -27,6 +27,11 @@ class ActionChoices(BitChoices):
(_("Clipboard"), [cls.copy, cls.paste]),
)
@classmethod
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"