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

Fix api permission check

This commit is contained in:
chapeau 2020-02-03 16:56:28 +00:00 committed by root
parent 8e37baef7b
commit ce4b3290dc

View file

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