django permission on api
This commit is contained in:
parent
cd6169d0b3
commit
5b268e4d35
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
from rest_framework.permissions import IsAuthenticatedOrReadOnly
|
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
|
||||||
|
|
||||||
from .models import Agent
|
from .models import Agent
|
||||||
from .serializers import AgentSerializer
|
from .serializers import AgentSerializer
|
||||||
|
@ -8,4 +8,4 @@ from .serializers import AgentSerializer
|
||||||
class AgentViewSet(viewsets.ModelViewSet):
|
class AgentViewSet(viewsets.ModelViewSet):
|
||||||
queryset = Agent.objects.all()
|
queryset = Agent.objects.all()
|
||||||
serializer_class = AgentSerializer
|
serializer_class = AgentSerializer
|
||||||
permission_class = [IsAuthenticatedOrReadOnly]
|
permission_class = [DjangoModelPermissionsOrAnonReadOnly]
|
||||||
|
|
Loading…
Reference in a new issue