From 11ad6ab273417be5e41e2d1d4810aa70b21beffd Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 20 Apr 2023 10:33:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=9C=AA=E5=BC=80=E5=90=AF=E7=9A=84acl?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=20(#10265)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复作业中心未开启的acl生效的问题 * perf: 优化代码风格 --------- Co-authored-by: Aaron3S --- apps/ops/models/job.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/ops/models/job.py b/apps/ops/models/job.py index a49885dff..193debe31 100644 --- a/apps/ops/models/job.py +++ b/apps/ops/models/job.py @@ -402,9 +402,11 @@ class JobExecution(JMSOrgBaseModel): def check_command_acl(self): for asset in self.current_job.assets.all(): - acls = CommandFilterACL.filter_queryset(user=self.creator, - asset=asset, - account_username=self.current_job.runas) + acls = CommandFilterACL.filter_queryset( + user=self.creator, + asset=asset, + is_active=True, + account_username=self.current_job.runas) for acl in acls: if self.match_command_group(acl, asset): break