jumpserver/apps/applications/api/application.py

20 lines
453 B
Python
Raw Normal View History

2020-10-19 12:13:01 +00:00
# coding: utf-8
#
from orgs.mixins.api import OrgBulkModelViewSet
from ..hands import IsOrgAdminOrAppUser
from .. import models, serializers
2020-10-19 12:13:01 +00:00
__all__ = ['ApplicationViewSet']
2020-10-19 12:13:01 +00:00
class ApplicationViewSet(OrgBulkModelViewSet):
2020-10-19 12:13:01 +00:00
model = models.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