From 5d6d795d60050c2c5db95501b6de38e458fd41b6 Mon Sep 17 00:00:00 2001 From: Matt DeTullio Date: Sun, 9 Mar 2014 23:28:49 -0400 Subject: [PATCH] Fixes a bug with group member administration --- app/models/ability.rb | 1 + features/group.feature | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 69ada75..1afe8a4 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -240,6 +240,7 @@ class Ability can_manage = group_abilities(user, group).include?(:manage_group) if can_manage && (user != target_user) rules << :modify + rules << :destroy end if !group.last_owner?(user) && (can_manage || (user == target_user)) rules << :destroy diff --git a/features/group.feature b/features/group.feature index 71282fb..4e11bcb 100644 --- a/features/group.feature +++ b/features/group.feature @@ -74,7 +74,7 @@ Feature: Groups When I visit group "Owned" members page Then I should see user "John Doe" 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 Scenario: Guest should be able to remove himself from group -- libgit2 0.21.2