Commit 4b946690 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #6503 from mjdetullio/fix/group-admin

[6.6] Fixes a bug with group member administration
parents 92a92846 5d6d795d
...@@ -240,6 +240,7 @@ class Ability ...@@ -240,6 +240,7 @@ class Ability
can_manage = group_abilities(user, group).include?(:manage_group) can_manage = group_abilities(user, group).include?(:manage_group)
if can_manage && (user != target_user) if can_manage && (user != target_user)
rules << :modify rules << :modify
rules << :destroy
end end
if !group.last_owner?(user) && (can_manage || (user == target_user)) if !group.last_owner?(user) && (can_manage || (user == target_user))
rules << :destroy rules << :destroy
......
...@@ -74,7 +74,7 @@ Feature: Groups ...@@ -74,7 +74,7 @@ Feature: Groups
When I visit group "Owned" members page When I visit group "Owned" members page
Then I should see user "John Doe" in team list Then I should see user "John Doe" in team list
Then I should see user "Mary Jane" in team list Then I should see user "Mary Jane" in team list
Then I should not see the "Remove User From Group" button for "Mary Jane" Then I should not see the "Remove User From Group" button for "John Doe"
@javascript @javascript
Scenario: Guest should be able to remove himself from group Scenario: Guest should be able to remove himself from group
......
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