From bb27ff7f8a07d40976e720a7522a8d94bb08ad9e Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:49:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=B9=E9=87=8F=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=85=B3=E9=97=AD=E4=BD=9C=E4=B8=9A=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E9=85=8D=E7=BD=AE=E5=90=8E=E4=B8=8A=E4=BC=A0=E4=BC=9A?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20(#12814)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 批量上传文件关闭作业中心配置后上传会报错 * fix: format --------- Co-authored-by: wangruidong <940853815@qq.com> Co-authored-by: Bai --- apps/ops/api/job.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/ops/api/job.py b/apps/ops/api/job.py index e82f8f618..26ce3ba8c 100644 --- a/apps/ops/api/job.py +++ b/apps/ops/api/job.py @@ -63,6 +63,10 @@ class JobViewSet(OrgBulkModelViewSet): model = Job def check_permissions(self, request): + # job: upload_file + if self.action == 'upload' or request.data.get('type') == Types.upload_file: + return super().check_permissions(request) + # job: adhoc, playbook if not settings.SECURITY_COMMAND_EXECUTION: return self.permission_denied(request, "Command execution disabled") return super().check_permissions(request)