mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Fixed api permissions
This commit is contained in:
parent
2822d947d9
commit
8e8ee808b5
@ -24,7 +24,7 @@ class RightManagedModelViewSet(viewsets.ModelViewSet):
|
|||||||
try:
|
try:
|
||||||
if (request.method == 'GET' and can_view(obj, user)):
|
if (request.method == 'GET' and can_view(obj, user)):
|
||||||
return res
|
return res
|
||||||
elif (request.method == 'PUSH' and can_edit(obj, user)):
|
elif (request.method != 'GET' and can_edit(obj, user)):
|
||||||
return res
|
return res
|
||||||
except: pass # To prevent bug with Anonymous user
|
except: pass # To prevent bug with Anonymous user
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
|
Loading…
Reference in New Issue
Block a user