django permission on api
This commit is contained in:
parent
4e77270a93
commit
f03c371255
1 changed files with 3 additions and 3 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 BudgetGroup, BudgetLine
|
from .models import BudgetGroup, BudgetLine
|
||||||
from .serializers import BudgetGroupSerializer, BudgetLineSerializer
|
from .serializers import BudgetGroupSerializer, BudgetLineSerializer
|
||||||
|
@ -8,10 +8,10 @@ from .serializers import BudgetGroupSerializer, BudgetLineSerializer
|
||||||
class BudgetGroupViewSet(viewsets.ModelViewSet):
|
class BudgetGroupViewSet(viewsets.ModelViewSet):
|
||||||
queryset = BudgetGroup.objects.all()
|
queryset = BudgetGroup.objects.all()
|
||||||
serializer_class = BudgetGroupSerializer
|
serializer_class = BudgetGroupSerializer
|
||||||
permission_class = [IsAuthenticatedOrReadOnly]
|
permission_class = [DjangoModelPermissionsOrAnonReadOnly]
|
||||||
|
|
||||||
|
|
||||||
class BudgetLineViewSet(viewsets.ModelViewSet):
|
class BudgetLineViewSet(viewsets.ModelViewSet):
|
||||||
queryset = BudgetLine.objects.all()
|
queryset = BudgetLine.objects.all()
|
||||||
serializer_class = BudgetLineSerializer
|
serializer_class = BudgetLineSerializer
|
||||||
permission_class = [IsAuthenticatedOrReadOnly]
|
permission_class = [DjangoModelPermissionsOrAnonReadOnly]
|
||||||
|
|
Loading…
Reference in a new issue