jumpserver/apps/applications/api/application.py

20 lines
470 B
Python
Raw Normal View History

2020-10-19 12:13:01 +00:00
# coding: utf-8
#
from orgs.mixins.api import OrgBulkModelViewSet
2021-06-11 03:05:40 +00:00
from ..hands import IsOrgAdminOrAppUser
from .. import serializers
2021-05-24 11:11:47 +00:00
from ..models import Application
2020-10-19 12:13:01 +00:00
2021-06-11 03:05:40 +00:00
__all__ = ['ApplicationViewSet']
2020-10-19 12:13:01 +00:00
class ApplicationViewSet(OrgBulkModelViewSet):
2021-05-24 11:11:47 +00:00
model = Application
filterset_fields = ('name', 'type', 'category')
search_fields = filterset_fields
2020-10-19 12:13:01 +00:00
permission_classes = (IsOrgAdminOrAppUser,)
serializer_class = serializers.ApplicationSerializer