Commit 6c3a41cc authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

Merge branch 'fix-permissions-error' into 'master'

Fix permissions error

See merge request !29
parents efc46b4b 552190e2
Pipeline #6999 passed with stage
in 27 seconds
......@@ -74,6 +74,10 @@ class ProjectMemberPermissions(LDPPermissions):
if request.user.is_anonymous and not request.method == 'OPTIONS':
return False
# I can remove myself
if obj.user.pk == request.user.pk:
return True
# admins have full permissions
if is_user_admin_of_project(request.user, obj.project):
if request.method == 'DELETE':
......@@ -89,8 +93,4 @@ class ProjectMemberPermissions(LDPPermissions):
return True
# I can remove myself
if obj.user.pk == request.user.pk:
return True
return super().has_object_permission(request, view, obj)
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