feat: 增加threshold_view权限标识

This commit is contained in:
caoqianming 2024-08-27 10:50:23 +08:00
parent 14340fe0c6
commit 30ce014de6
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ class SourceViewSet(ModelViewSet):
class ThresholdViewSet(ModelViewSet): class ThresholdViewSet(ModelViewSet):
perms_map = [ perms_map = [
{'get': '*'}, {'post': 'threshold_update'}, {'get': 'threshold_view'}, {'post': 'threshold_update'},
{'put': 'threshold_update'}, {'delete': 'threshold_update'}] {'put': 'threshold_update'}, {'delete': 'threshold_update'}]
queryset = Threshold.objects.filter(is_delete=0) queryset = Threshold.objects.filter(is_delete=0)
serializer_class = ThresholdSerializer serializer_class = ThresholdSerializer
@ -95,7 +95,7 @@ class ThresholdViewSet(ModelViewSet):
search_fields = ['chinese_name','cas', 'compound_cate', 'odor_type'] search_fields = ['chinese_name','cas', 'compound_cate', 'odor_type']
filterset_fields = ['source', 'compound_cate'] filterset_fields = ['source', 'compound_cate']
@action(methods=['post'], detail=False, perms_map=[{'post':'threshold'}], serializer_class=PathSerializer) @action(methods=['post'], detail=False, perms_map=[{'post':'threshold_update'}], serializer_class=PathSerializer)
@transaction.atomic @transaction.atomic
def daoru(self, request, *args, **kwargs): def daoru(self, request, *args, **kwargs):
'''导入excel '''导入excel