diff --git a/app/models/ability.rb b/app/models/ability.rb index 69ada753d026d22d57a2cb337852a35a2696292a..1afe8a4638f5a6e2feb9c15052cdf07aea08ed7a 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 71282fb75bacbd7cb7b2ee64a254a27782e0416b..4e11bcba9390c72c349d9ff9d51f35e9f1c1119b 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 diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index d18fc8bf2cecbe21bbbd5da692eaf83e32c48638..e932b64f4f0ce1ac5a4e038e5360cc2009a98a92 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -7,7 +7,7 @@ module Gitlab end def project_name_regex - /\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/ + /\A[a-zA-Z0-9_][a-zA-Z0-9_\-\. ]*\z/ end def name_regex @@ -49,7 +49,7 @@ module Gitlab protected def default_regex - /\A[.?]?[a-zA-Z0-9][a-zA-Z0-9_\-\.]*(?<!\.git)\z/ + /\A[.?]?[a-zA-Z0-9_][a-zA-Z0-9_\-\.]*(?<!\.git)\z/ end end end