Skip to content

Commit

Permalink
Changed to authenticated or readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurr0y committed Nov 22, 2023
1 parent 8d6dd91 commit 26cc620
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/events/views/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework import viewsets
from events.serializers.serializers import *
from rest_framework.permissions import AllowAny
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from events.models.costs import Costs
from events.models.event import Event
from events.models.participant import Participant
Expand All @@ -9,26 +9,26 @@

class CostsViewSet(viewsets.ModelViewSet):
serializer_class = CostsSerializer
permission_classes = [AllowAny]
permission_classes = [IsAuthenticatedOrReadOnly]
queryset = Costs.objects.all()

class EventViewSet(viewsets.ModelViewSet):
serializer_class = EventSerializer
permission_classes = [AllowAny]
permission_classes = [IsAuthenticatedOrReadOnly]
queryset = Event.objects.all()

class ParticipantViewSet(viewsets.ModelViewSet):
serializer_class = ParticipantSerializer
permission_classes = [AllowAny]
permission_classes = [IsAuthenticatedOrReadOnly]
queryset = Participant.objects.all()

class EventApplicationViewSet(viewsets.ModelViewSet):
serializer_class = EventApplicationSerializer
permission_classes = [AllowAny]
permission_classes = [IsAuthenticatedOrReadOnly]
queryset = EventApplication.objects.all()

class TicketViewSet(viewsets.ModelViewSet):
serializer_class = TicketSerializer
permission_classes = [AllowAny]
permission_classes = [IsAuthenticatedOrReadOnly]
queryset = Ticket.objects.all()

6 changes: 3 additions & 3 deletions src/involvement/views/position_api.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from rest_framework import viewsets
from involvement.serializers.position_serializer import PositionSerializer, PositionDepthSerializer
from rest_framework.permissions import AllowAny
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from involvement.models.position import Position

class PositionViewSet(viewsets.ModelViewSet):
serializer_class = PositionSerializer
permission_classes = [AllowAny]
permission_classes = [IsAuthenticatedOrReadOnly]
queryset = Position.objects.all()

class Position2ViewSet(viewsets.ModelViewSet):
serializer_class = PositionDepthSerializer
permission_classes = [AllowAny]
permission_classes = [IsAuthenticatedOrReadOnly]
queryset = Position.objects.all()

0 comments on commit 26cc620

Please sign in to comment.