mirror of https://github.com/jumpserver/jumpserver
fix: 修复bug
parent
62aeaf31c6
commit
3751b4158e
|
@ -54,12 +54,3 @@ class UserConnectionTokenApi(RootOrgViewMixin, APIView):
|
||||||
return Response(value)
|
return Response(value)
|
||||||
else:
|
else:
|
||||||
return Response({'user': value['user']})
|
return Response({'user': value['user']})
|
||||||
|
|
||||||
def get_permissions(self):
|
|
||||||
if self.request.query_params.get('user-only', None):
|
|
||||||
self.permission_classes = (AllowAny,)
|
|
||||||
return super().get_permissions()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,11 @@ class CeleryLogWebsocket(JsonWebsocketConsumer):
|
||||||
disconnected = False
|
disconnected = False
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
|
user = self.scope["user"]
|
||||||
|
if user.is_authenticated and user.is_org_admin:
|
||||||
self.accept()
|
self.accept()
|
||||||
|
else:
|
||||||
|
self.close()
|
||||||
|
|
||||||
def receive(self, text_data=None, bytes_data=None, **kwargs):
|
def receive(self, text_data=None, bytes_data=None, **kwargs):
|
||||||
data = json.loads(text_data)
|
data = json.loads(text_data)
|
||||||
|
|
Loading…
Reference in New Issue