Commit c89cedc5 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

fix: does not allow to remove other admins

parent 8471e811
Pipeline #7015 passed with stage
in 27 seconds
......@@ -33,7 +33,10 @@ class ProjectMemberPermissions(LDPPermissions):
else:
if obj.project.members.filter(user=user).exists():
if obj.project.members.filter(user=user).get().is_admin:
return ['view', 'add', 'delete']
if obj.is_admin:
return ['view', 'add']
else:
return ['view', 'add', 'delete']
else:
return ['view']
......
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