changes to views permissions
This commit is contained in:
@@ -2,10 +2,15 @@ from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.permissions import IsAuthenticatedOrReadOnly
|
||||
|
||||
from products.models import Product
|
||||
from products.serializers import ProductSerializer
|
||||
|
||||
from back_latienda.permissions import IsCreator
|
||||
|
||||
|
||||
class ProductViewSet(viewsets.ModelViewSet):
|
||||
queryset = Product.objects.all()
|
||||
serializer_class = ProductSerializer
|
||||
permission_classes = [IsAuthenticatedOrReadOnly, IsCreator]
|
||||
|
||||
Reference in New Issue
Block a user