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.permissions import IsAuthenticatedOrReadOnly
|
||||
from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly
|
||||
|
||||
from .models import BudgetGroup, BudgetLine
|
||||
from .serializers import BudgetGroupSerializer, BudgetLineSerializer
|
||||
|
@ -8,10 +8,10 @@ from .serializers import BudgetGroupSerializer, BudgetLineSerializer
|
|||
class BudgetGroupViewSet(viewsets.ModelViewSet):
|
||||
queryset = BudgetGroup.objects.all()
|
||||
serializer_class = BudgetGroupSerializer
|
||||
permission_class = [IsAuthenticatedOrReadOnly]
|
||||
permission_class = [DjangoModelPermissionsOrAnonReadOnly]
|
||||
|
||||
|
||||
class BudgetLineViewSet(viewsets.ModelViewSet):
|
||||
queryset = BudgetLine.objects.all()
|
||||
serializer_class = BudgetLineSerializer
|
||||
permission_class = [IsAuthenticatedOrReadOnly]
|
||||
permission_class = [DjangoModelPermissionsOrAnonReadOnly]
|
||||
|
|
Loading…
Reference in a new issue