diff options
author | Nick Thomas <nick@gitlab.com> | 2019-02-27 14:53:44 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-02-27 14:53:44 +0300 |
commit | 61c1509cc992959ac5021d10825d5dbf9dd2c091 (patch) | |
tree | 604e6883340385d500c0a531f3f057159a432399 | |
parent | da8fce1f04e169837ec3526617464836f741e276 (diff) | |
parent | b81e7c52d3e82e0c053a39fac9c4fe21abcf6103 (diff) |
Merge branch '58149-fix-read-list-board-policy' into 'master'
Allow `:read_list` when `:read_group` is allowed
Closes #58149
See merge request gitlab-org/gitlab-ce!25524
-rw-r--r-- | app/policies/group_policy.rb | 1 | ||||
-rw-r--r-- | changelogs/unreleased/58149-fix-read-list-board-policy.yml | 6 | ||||
-rw-r--r-- | spec/policies/group_policy_spec.rb | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index c25766a5af8..298769c0eb8 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -54,6 +54,7 @@ class GroupPolicy < BasePolicy rule { has_projects }.policy do enable :read_group + enable :read_list enable :read_label end diff --git a/changelogs/unreleased/58149-fix-read-list-board-policy.yml b/changelogs/unreleased/58149-fix-read-list-board-policy.yml new file mode 100644 index 00000000000..964813f4c9a --- /dev/null +++ b/changelogs/unreleased/58149-fix-read-list-board-policy.yml @@ -0,0 +1,6 @@ +--- +title: Fix error when viewing group issue boards when user doesn't have explicit group + permissions +merge_request: 25524 +author: +type: fixed diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb index be1804c5ce0..af6d6f084a9 100644 --- a/spec/policies/group_policy_spec.rb +++ b/spec/policies/group_policy_spec.rb @@ -83,7 +83,7 @@ describe GroupPolicy do end it do - expect_allowed(:read_group, :read_label) + expect_allowed(:read_group, :read_list, :read_label) end context 'in subgroups', :nested_groups do @@ -91,7 +91,7 @@ describe GroupPolicy do let(:project) { create(:project, namespace: subgroup) } it do - expect_allowed(:read_group, :read_label) + expect_allowed(:read_group, :read_list, :read_label) end end end |