Commit 2bbc8771 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

Merge branch 'master' of git.happy-dev.fr:startinblox/djangoldp-packages/djangoldp-project

parents ef09ff0f 68422fef
Pipeline #6752 passed with stage
in 27 seconds
......@@ -15,6 +15,10 @@ 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:
return False
# request on an existing resource - this will be reviewed by has_object_permission
if request.method == 'PATCH' or request.method == 'DELETE' or request.method == 'PUT':
return True
......@@ -42,6 +46,10 @@ class ProjectMemberPermissions(LDPPermissions):
def has_permission(self, request, view):
from djangoldp.models import Model
# anonymous users have no rights
if request.user.is_anonymous:
return False
# request on an existing resource - this will be reviewed by has_object_permission
if request.method == 'PATCH' or request.method == 'DELETE' or request.method == 'PUT':
return True
......
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