perf: 批量上传添加权限校验

This commit is contained in:
wangruidong
2024-04-03 15:44:32 +08:00
committed by Bryan
parent 0aeea414f5
commit 9776d35140
7 changed files with 107 additions and 42 deletions

View File

@@ -42,6 +42,10 @@ class ActionChoices(BitChoices):
def contains(cls, total, action_value):
return action_value & total == action_value
@classmethod
def contains_all(cls, total, action_values):
return all(cls.contains(total, action) for action in action_values)
@classmethod
def display(cls, value):
return ', '.join([str(c.label) for c in cls if c.value & value == c.value])