2019-12-19 07:28:17 +00:00
|
|
|
# coding: utf-8
|
|
|
|
#
|
|
|
|
|
|
|
|
from orgs.mixins.api import OrgBulkModelViewSet
|
|
|
|
|
|
|
|
from .. import models, serializers
|
|
|
|
from common.permissions import IsOrgAdmin
|
|
|
|
|
|
|
|
|
|
|
|
__all__ = ['DatabaseAppPermissionViewSet']
|
|
|
|
|
|
|
|
|
|
|
|
class DatabaseAppPermissionViewSet(OrgBulkModelViewSet):
|
|
|
|
model = models.DatabaseAppPermission
|
2019-12-20 07:55:59 +00:00
|
|
|
serializer_classes = {
|
|
|
|
'default': serializers.DatabaseAppPermissionSerializer,
|
|
|
|
'display': serializers.DatabaseAppPermissionListSerializer
|
|
|
|
}
|
2019-12-19 07:28:17 +00:00
|
|
|
filter_fields = ('name',)
|
|
|
|
search_fields = filter_fields
|
|
|
|
permission_classes = (IsOrgAdmin,)
|