Browse Source

Add permission to TagList

pull/1349/head
Hironsan 3 years ago
parent
commit
87da2e309a
1 changed files with 3 additions and 0 deletions
  1. 3
      backend/api/views/tag.py

3
backend/api/views/tag.py

@ -1,14 +1,17 @@
from django.shortcuts import get_object_or_404
from rest_framework import generics, status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from ..models import Project, Tag
from ..permissions import IsInProjectReadOnlyOrAdmin
from ..serializers import TagSerializer
class TagList(generics.ListCreateAPIView):
serializer_class = TagSerializer
pagination_class = None
permission_classes = [IsAuthenticated & IsInProjectReadOnlyOrAdmin]
def get_queryset(self):
project = get_object_or_404(Project, pk=self.kwargs['project_id'])

Loading…
Cancel
Save