From 967800391e97f24d7294c7f94cf18b5175b73a0c Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 12 Apr 2018 17:31:37 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E6=9B=B4=E6=96=B0api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/urls.py | 6 ++++-- apps/terminal/api.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/jumpserver/urls.py b/apps/jumpserver/urls.py index ced4797d5..e98d17dbc 100644 --- a/apps/jumpserver/urls.py +++ b/apps/jumpserver/urls.py @@ -36,9 +36,11 @@ urlpatterns = [ url(r'^captcha/', include('captcha.urls')), ] +urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \ + + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + if settings.DEBUG: urlpatterns += [ url(r'^docs/', schema_view, name="docs"), - ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \ - + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + ] diff --git a/apps/terminal/api.py b/apps/terminal/api.py index 8247ac27c..e625e17bc 100644 --- a/apps/terminal/api.py +++ b/apps/terminal/api.py @@ -248,7 +248,7 @@ class CommandViewSet(viewsets.ViewSet): class SessionReplayViewSet(viewsets.ViewSet): serializer_class = ReplaySerializer - permission_classes = () + permission_classes = (IsSuperUserOrAppUser,) session = None def gen_session_path(self):