2019-03-04 12:45:57 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2024-01-02 08:11:56 +00:00
|
|
|
|
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
|
2022-11-11 07:04:31 +00:00
|
|
|
from perms.filters import AssetPermissionFilter
|
|
|
|
from perms.models import AssetPermission
|
2019-03-04 12:45:57 +00:00
|
|
|
|
2022-02-17 12:13:31 +00:00
|
|
|
__all__ = ['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
|
|
|
|
"""
|
2019-10-18 07:05:45 +00:00
|
|
|
model = AssetPermission
|
2024-01-02 08:11:56 +00:00
|
|
|
serializer_classes = {
|
|
|
|
'default': serializers.AssetPermissionSerializer,
|
|
|
|
'list': serializers.AssetPermissionListSerializer,
|
|
|
|
}
|
2021-02-24 04:06:31 +00:00
|
|
|
filterset_class = AssetPermissionFilter
|
2021-04-06 11:43:37 +00:00
|
|
|
search_fields = ('name',)
|
2022-11-11 07:04:31 +00:00
|
|
|
ordering = ('name',)
|