mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-04 17:01:09 +00:00
perf: 添加 check api 避免未认证
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
from django.views.generic import TemplateView
|
||||
from django.conf import settings
|
||||
from django.http import HttpResponse
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from common.views.mixins import PermissionsMixin
|
||||
from rbac.permissions import RBACPermission
|
||||
@@ -16,6 +17,11 @@ class CeleryTaskLogView(PermissionsMixin, TemplateView):
|
||||
'GET': 'ops.view_celerytaskexecution'
|
||||
}
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
if not request.user.is_authenticated:
|
||||
return HttpResponse(status=401)
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context.update({
|
||||
|
Reference in New Issue
Block a user