diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-04-24 10:10:54 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-04-24 10:10:54 +0300 |
commit | 8a726a0842f4a8e5b86d2a44c7c16219632f4249 (patch) | |
tree | 8b8b3b941787e8e5b09e6df07f5161c05a04b274 /app | |
parent | d3db21b4cff2f8a52446b67fee8921f1e3a8d0b3 (diff) | |
parent | 2b5ac11591848daaea582034ebd07663d9e40dd0 (diff) |
Merge branch 'issue_45463' into 'master'
Fix users not seeing labels from private groups when being a member of a child project
Closes #45463
See merge request gitlab-org/gitlab-ce!18544
Diffstat (limited to 'app')
-rw-r--r-- | app/policies/group_policy.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index c9cb730c4e9..520710b757d 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -22,7 +22,7 @@ class GroupPolicy < BasePolicy condition(:can_change_parent_share_with_group_lock) { can?(:change_share_with_group_lock, @subject.parent) } condition(:has_projects) do - GroupProjectsFinder.new(group: @subject, current_user: @user).execute.any? + GroupProjectsFinder.new(group: @subject, current_user: @user, options: { include_subgroups: true }).execute.any? end with_options scope: :subject, score: 0 @@ -43,7 +43,11 @@ class GroupPolicy < BasePolicy end rule { admin } .enable :read_group - rule { has_projects } .enable :read_group + + rule { has_projects }.policy do + enable :read_group + enable :read_label + end rule { has_access }.enable :read_namespace |