From 8e8ee808b5099b537a23e7f61451387c36b8d59f Mon Sep 17 00:00:00 2001 From: klmp200 Date: Sun, 7 Aug 2016 20:52:53 +0200 Subject: [PATCH] Fixed api permissions --- api/views/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/views/__init__.py b/api/views/__init__.py index b03cc1d7..97682e80 100644 --- a/api/views/__init__.py +++ b/api/views/__init__.py @@ -24,7 +24,7 @@ class RightManagedModelViewSet(viewsets.ModelViewSet): try: if (request.method == 'GET' and can_view(obj, user)): return res - elif (request.method == 'PUSH' and can_edit(obj, user)): + elif (request.method != 'GET' and can_edit(obj, user)): return res except: pass # To prevent bug with Anonymous user raise PermissionDenied