blob: d8c3b283cd0b41178c36e2d7cc436e7e19c3d749 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# frozen_string_literal: true
module IncidentManagement
class TimelineEventPolicy < ::BasePolicy
delegate { @subject.incident }
condition(:is_editable, scope: :subject, score: 0) { @subject.editable? }
rule { ~can?(:admin_incident_management_timeline_event) }.policy do
prevent :edit_incident_management_timeline_event
end
rule { is_editable }.policy do
enable :edit_incident_management_timeline_event
end
end
end
|