2019-09-30 23:59:55 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-17 16:20:25 +05:30
|
|
|
class ResourceLabelEventPolicy < ResourceEventPolicy
|
2019-09-30 23:59:55 +05:30
|
|
|
condition(:can_read_label) { @subject.label_id.nil? || can?(:read_label, @subject.label) }
|
|
|
|
|
|
|
|
rule { can_read_label }.policy do
|
|
|
|
enable :read_label
|
|
|
|
end
|
|
|
|
|
|
|
|
rule { can_read_label & can_read_issuable }.policy do
|
|
|
|
enable :read_resource_label_event
|
2023-03-17 16:20:25 +05:30
|
|
|
enable :read_note
|
2019-09-30 23:59:55 +05:30
|
|
|
end
|
|
|
|
end
|