8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 03:13:12 +00:00

Merge branch 'fix_api_perm_check' into 'master'

Fix api permission check

See merge request federez/re2o!484
This commit is contained in:
Yoann Pétri 2020-02-03 18:20:43 +01:00
commit 706b309a2a

View file

@ -23,7 +23,7 @@
"""
from rest_framework import permissions, exceptions
from django.http import Http404
from . import acl
@ -273,6 +273,8 @@ class AutodetectACLPermission(permissions.BasePermission):
# they have read permissions to see 403, or not, and simply see
# a 404 response.
SAFE_METHODS = ("GET", "OPTIONS", "HEAD", "POST", "PUT", "PATCH", "DELETE")
if request.method in SAFE_METHODS:
# Read permissions already checked and failed, no need
# to make another lookup.