mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-23 00:01:16 +00:00
Fixed api permissions
This commit is contained in:
parent
2822d947d9
commit
8e8ee808b5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user