fix: 增加作业中心开关

pull/9553/head
Aaron3S 2 years ago committed by Jiangjie.Bai
parent 09b672917a
commit 1b4c52bc9f

@ -1,3 +1,4 @@
from django.conf import settings
from django.db.models import Count from django.db.models import Count
from django.db.transaction import atomic from django.db.transaction import atomic
from rest_framework.views import APIView from rest_framework.views import APIView
@ -30,6 +31,11 @@ class JobViewSet(OrgBulkModelViewSet):
search_fields = ('name', 'comment') search_fields = ('name', 'comment')
model = Job model = Job
def check_permissions(self, request):
if not settings.SECURITY_COMMAND_EXECUTION:
return self.permission_denied(request, "Command execution disabled")
return super().check_permissions(request)
def allow_bulk_destroy(self, qs, filtered): def allow_bulk_destroy(self, qs, filtered):
return True return True

Loading…
Cancel
Save