mirror of https://github.com/jumpserver/jumpserver
parent
1a011f34a1
commit
043d24a8f7
|
@ -54,12 +54,3 @@ class UserConnectionTokenApi(RootOrgViewMixin, APIView):
|
|||
return Response(value)
|
||||
else:
|
||||
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
|
||||
|
||||
def connect(self):
|
||||
self.accept()
|
||||
user = self.scope["user"]
|
||||
if user.is_authenticated and user.is_org_admin:
|
||||
self.accept()
|
||||
else:
|
||||
self.close()
|
||||
|
||||
def receive(self, text_data=None, bytes_data=None, **kwargs):
|
||||
data = json.loads(text_data)
|
||||
|
|
Loading…
Reference in New Issue