2019-03-04 12:45:57 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2021-02-24 04:06:31 +00:00
|
|
|
from perms.filters import AssetPermissionFilter
|
2020-10-22 10:13:14 +00:00
|
|
|
from perms.models import AssetPermission
|
2021-02-24 04:06:31 +00:00
|
|
|
from orgs.mixins.api import OrgBulkModelViewSet
|
2020-10-22 10:13:14 +00:00
|
|
|
from perms import serializers
|
2021-02-24 04:06:31 +00:00
|
|
|
from common.permissions import IsOrgAdmin
|
2019-03-04 12:45:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
__all__ = [
|
2019-12-05 07:09:25 +00:00
|
|
|
'AssetPermissionViewSet',
|
2019-03-04 12:45:57 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
2021-02-24 04:06:31 +00:00
|
|
|
class AssetPermissionViewSet(OrgBulkModelViewSet):
|
2019-03-04 12:45:57 +00:00
|
|
|
"""
|
|
|
|
资产授权列表的增删改查api
|
|
|
|
"""
|
2021-02-24 04:06:31 +00:00
|
|
|
permission_classes = (IsOrgAdmin,)
|
2019-10-18 07:05:45 +00:00
|
|
|
model = AssetPermission
|
2020-05-09 06:51:19 +00:00
|
|
|
serializer_class = serializers.AssetPermissionSerializer
|
2021-02-24 04:06:31 +00:00
|
|
|
filterset_class = AssetPermissionFilter
|
2021-04-06 11:43:37 +00:00
|
|
|
search_fields = ('name',)
|