From 5b268e4d3590874ac96529b1e6e23a8bf22e45f6 Mon Sep 17 00:00:00 2001 From: sinavir Date: Thu, 16 Feb 2023 19:10:50 +0100 Subject: [PATCH] django permission on api --- hackens_orga/agent/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hackens_orga/agent/views.py b/hackens_orga/agent/views.py index 9904fcb..53dc4ad 100644 --- a/hackens_orga/agent/views.py +++ b/hackens_orga/agent/views.py @@ -1,5 +1,5 @@ from rest_framework import viewsets -from rest_framework.permissions import IsAuthenticatedOrReadOnly +from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly from .models import Agent from .serializers import AgentSerializer @@ -8,4 +8,4 @@ from .serializers import AgentSerializer class AgentViewSet(viewsets.ModelViewSet): queryset = Agent.objects.all() serializer_class = AgentSerializer - permission_class = [IsAuthenticatedOrReadOnly] + permission_class = [DjangoModelPermissionsOrAnonReadOnly]