Commit 3e3a767c authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

fix: anonymous allowed for OPTIONS requests

parent 2bbc8771
Pipeline #6755 passed with stage
in 27 seconds
......@@ -16,7 +16,7 @@ def is_user_admin_of_project(user, project):
class ProjectPermissions(LDPPermissions):
def has_permission(self, request, view):
# anonymous users have no rights
if request.user.is_anonymous:
if request.user.is_anonymous and not request.method == 'OPTIONS':
return False
# request on an existing resource - this will be reviewed by has_object_permission
......@@ -47,7 +47,7 @@ class ProjectMemberPermissions(LDPPermissions):
from djangoldp.models import Model
# anonymous users have no rights
if request.user.is_anonymous:
if request.user.is_anonymous and not request.method == 'OPTIONS':
return False
# request on an existing resource - this will be reviewed by has_object_permission
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment