feat: 修改命令过滤规则Model: 添加Action-reconfirm; 添加field-reviewers

This commit is contained in:
Bai
2021-04-26 15:33:51 +08:00
committed by Jiangjie.Bai
parent 63efbfe62e
commit e9b174f342
4 changed files with 44 additions and 12 deletions

View File

@@ -196,9 +196,9 @@ class SystemUser(BaseUser):
def is_command_can_run(self, command):
for rule in self.cmd_filter_rules:
action, matched_cmd = rule.match(command)
if action == rule.ACTION_ALLOW:
if action == rule.ActionChoices.allow:
return True, None
elif action == rule.ACTION_DENY:
elif action == rule.ActionChoices.deny:
return False, matched_cmd
return True, None