mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-05 19:16:37 +00:00
fix: 增加作业中心开关
This commit is contained in:
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…
Reference in New Issue
Block a user