mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-05 18:34:15 +00:00
Fixed api permissions
This commit is contained in:
1 parent
2822d947d9
commit
8e8ee808b5
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user