mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-05 09:21:02 +00:00
perf: 批量上传添加权限校验
This commit is contained in:
@@ -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])
|
||||
|
Reference in New Issue
Block a user