mirror of https://github.com/jumpserver/jumpserver
fix: 批量上传文件关闭作业中心配置后上传会报错 (#12814)
* fix: 批量上传文件关闭作业中心配置后上传会报错 * fix: format --------- Co-authored-by: wangruidong <940853815@qq.com> Co-authored-by: Bai <baijiangjie@gmail.com>pull/12832/head
parent
0671e56d65
commit
bb27ff7f8a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue