This commit is contained in:
caoqianming 2020-04-02 22:15:56 +08:00
parent d19e87a5e5
commit 0df7db43d3
3 changed files with 8 additions and 9 deletions

View File

@ -8,12 +8,11 @@ from rest_framework.permissions import IsAuthenticated
ConsumerPerms = [
'paper_list',
'gen_monitest',
'my_collects',
'my_paid',
'examtest_selftest',
'examtest_selffx',
'examtest_create',
'questioncat_list'
'my_collects',
'my_subjects',
'my_examtest',
'examtest_create',
]
class MyPermission(RbacPermission):

View File

@ -109,7 +109,7 @@ class ConsumerViewSet(ModelViewSet):
return Response(serializer.data)
@action(methods=['get'], detail=False,
url_path='subjectpaid', url_name='subject_paid',perms_map=[{'get':'my_paid'}])
url_path='subjectpaid', url_name='subject_paid',perms_map=[{'*':'my_subject'}])
def has_paid(self, request):
"""
当前登陆消费者已付费的学科
@ -136,7 +136,7 @@ class ConsumerViewSet(ModelViewSet):
return Response({'error':result['data']})
@action(methods=['post','delete','get'], detail=False,
url_path='collects', url_name='create_collects', perms_map=[{'get':'my_collects'}])
url_path='collects', url_name='create_collects', perms_map=[{'*':'my_collects'}])
def collects(self, request):
'''
个人收藏集

View File

@ -159,7 +159,7 @@ class ExamTestViewSet(ModelViewSet):
filter_backends = [DjangoFilterBackend, SearchFilter, OrderingFilter]
filterset_fields = ['type','is_pass']
@action(methods=['get'], detail=False,url_path='self', url_name='selftest', perms_map = [{'get':'examtest_selftest'}])
@action(methods=['get'], detail=False,url_path='self', url_name='selftest', perms_map = [{'*':'my_examtest'}])
def selftest(self, request, pk=None):
'''
个人考试记录
@ -170,7 +170,7 @@ class ExamTestViewSet(ModelViewSet):
serializer = ExamTestListSerializer(instance=p,many=True)
return pg.get_paginated_response(serializer.data)
@action(methods=['get'], detail=False,url_path='fx', url_name='selffx', perms_map = [{'get':'examtest_selffx'}])
@action(methods=['get'], detail=False,url_path='fx', url_name='selffx', perms_map = [{'*':'my_examtest'}])
def selffx(self, request, pk=None):
'''
个人考试分析