Commit 552190e2 authored by Calum Mackervoy's avatar Calum Mackervoy

fixed bug where users couldnt remove themselves

parent 9beaf144
Pipeline #6996 passed with stage
in 29 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