summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorJames Lopez <james@gitlab.com>2019-05-02 06:35:06 +0000
committerJames Lopez <james@gitlab.com>2019-05-02 06:35:06 +0000
commit2b3b0bb1847e5d910b3e5dc5e151f194c12d3907 (patch)
tree2fc45e9e88dcf2d2c916cd2baf5ff2da243d152c /app/models
parent6835a64d575ddcaa460d82ad224e208ef448840e (diff)
parent32ddc3fed616b9eebdd7b5553d4aa08c0572ff1d (diff)
downloadgitlab-ce-2b3b0bb1847e5d910b3e5dc5e151f194c12d3907.tar.gz
Merge branch 'sh-allow-equal-level-in-subgroup-membership' into 'master'
Allow a member to have an access level equal to parent group Closes gitlab-ee#11323 See merge request gitlab-org/gitlab-ce!27913
Diffstat (limited to 'app/models')
-rw-r--r--app/models/member.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/member.rb b/app/models/member.rb
index 8a06bff51b5..83b4f5b29c4 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -446,10 +446,10 @@ class Member < ApplicationRecord
end
def higher_access_level_than_group
- if highest_group_member && highest_group_member.access_level >= access_level
+ if highest_group_member && highest_group_member.access_level > access_level
error_parameters = { access: highest_group_member.human_access, group_name: highest_group_member.group.name }
- errors.add(:access_level, s_("should be higher than %{access} inherited membership from group %{group_name}") % error_parameters)
+ errors.add(:access_level, s_("should be greater than or equal to %{access} inherited membership from group %{group_name}") % error_parameters)
end
end
end