Browse Source

Fix api permission check

fix_dhcp_api_serializer
chapeau 6 years ago
committed by root
parent
commit
ce4b3290dc
  1. 4
      api/permissions.py

4
api/permissions.py

@ -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.

Loading…
Cancel
Save