mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
added request.method == 'options'
This commit is contained in:
parent
b090ae9d30
commit
953c29c12d
|
@ -44,8 +44,10 @@ class IsAuthenticated(BasePermission):
|
|||
"""
|
||||
Allows access only to authenticated users.
|
||||
"""
|
||||
|
||||
# DRF should authorize all OPTIONS requests by default #5616
|
||||
def has_permission(self, request, view):
|
||||
if request.method == 'OPTIONS':
|
||||
return True
|
||||
return request.user and request.user.is_authenticated
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user