b2da8042b4
Due to a bug in `BoardPolicy`, users were getting back a 403 error when trying to assign users to an assignee list and seeing "Something went wrong while fetching assignees list". For some reason, the declarative policy runtime was ignoring the ternary condition. To work around the issue, we make the project board an explicit condition check. Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/9727
16 lines
420 B
Ruby
16 lines
420 B
Ruby
# frozen_string_literal: true
|
|
|
|
class BoardPolicy < BasePolicy
|
|
delegate { @subject.parent }
|
|
|
|
condition(:is_group_board) { @subject.group_board? }
|
|
condition(:is_project_board) { @subject.project_board? }
|
|
|
|
rule { is_project_board & can?(:read_project) }.enable :read_parent
|
|
|
|
rule { is_group_board & can?(:read_group) }.policy do
|
|
enable :read_parent
|
|
enable :read_milestone
|
|
enable :read_issue
|
|
end
|
|
end
|