From c4b7b80e1a08cddda1fce93768d79d7d3e0cddce Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 14 Apr 2017 12:58:43 +1000 Subject: [PATCH] Added stock permissison --- InvenTree/stock/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index c7d5cfe8b5..779bdc9695 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -9,6 +9,7 @@ class StockDetail(generics.RetrieveUpdateDestroyAPIView): queryset = StockItem.objects.all() serializer_class = StockItemSerializer + permission_classes = (permissions.IsAuthenticatedOrReadOnly,) class StockFilter(django_filters.rest_framework.FilterSet): @@ -49,12 +50,14 @@ class StockList(generics.ListCreateAPIView): request.data['part'] = part_id return super(StockList, self).create(request, *args, **kwargs) + class LocationDetail(generics.RetrieveUpdateDestroyAPIView): """ Return information on a specific stock location """ queryset = StockLocation.objects.all() serializer_class = LocationDetailSerializer + permission_classes = (permissions.IsAuthenticatedOrReadOnly,) class LocationList(generics.ListCreateAPIView): @@ -81,3 +84,4 @@ class LocationList(generics.ListCreateAPIView): return locations serializer_class = LocationDetailSerializer + permission_classes = (permissions.IsAuthenticatedOrReadOnly,)