gitlab-org--gitlab-foss/app/policies/board_policy.rb

15 lines
355 B
Ruby
Raw Normal View History

2019-01-17 12:40:37 -05:00
# frozen_string_literal: true
class BoardPolicy < BasePolicy
delegate { @subject.parent }
condition(:is_group_board) { @subject.group_board? }
rule { is_group_board ? can?(:read_group) : can?(:read_project) }.enable :read_parent
rule { is_group_board & can?(:read_group) }.policy do
enable :read_milestone
enable :read_issue
end
end