summaryrefslogtreecommitdiff
path: root/app/models/ability.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-01 20:47:26 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-01 20:53:43 -0200
commit67cc6b0642573fe443126042dd36b15f05bc539c (patch)
treeb96ee2828722a7363d45e2ef6d4b5a2b9a478867 /app/models/ability.rb
parent9ab7bdf7739935bf79c2e033212726a4be421a26 (diff)
downloadgitlab-ce-67cc6b0642573fe443126042dd36b15f05bc539c.tar.gz
Signed in admin should be able to add/remove himself to a project
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r--app/models/ability.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 10c41306c55..cd5ae0fb0fd 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -365,12 +365,10 @@ class Ability
unless target_user == project.owner
can_manage = project_abilities(user, project).include?(:admin_project_member)
- if can_manage && user != target_user
+ if can_manage
rules << :update_project_member
rules << :destroy_project_member
- end
-
- if user == target_user
+ elsif user == target_user
rules << :destroy_project_member
end
end