fix: 修复作业中心未开启的acl生效的问题 (#10265)

* fix: 修复作业中心未开启的acl生效的问题

* perf: 优化代码风格

---------

Co-authored-by: Aaron3S <chenyang@fit2cloud.com>
pull/10267/head
fit2bot 2023-04-20 10:33:53 +08:00 committed by GitHub
parent 2ba32f6971
commit 11ad6ab273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -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