mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-12-23 12:33:00 +00:00
perf: 资产授权添加协议
This commit is contained in:
15
apps/assets/api/protocol.py
Normal file
15
apps/assets/api/protocol.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from rest_framework.generics import ListAPIView
|
||||
|
||||
from assets import serializers
|
||||
from assets.const import Protocol
|
||||
from common.permissions import IsValidUser
|
||||
|
||||
__all__ = ['ProtocolListApi']
|
||||
|
||||
|
||||
class ProtocolListApi(ListAPIView):
|
||||
serializer_class = serializers.ProtocolSerializer
|
||||
permission_classes = (IsValidUser,)
|
||||
|
||||
def get_queryset(self):
|
||||
return list(Protocol.protocols())
|
||||
Reference in New Issue
Block a user