debian-mirror-gitlab/app/policies/incident_management/timeline_event_policy.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
458 B
Ruby
Raw Normal View History

2022-07-16 23:28:13 +05:30
# frozen_string_literal: true
module IncidentManagement
class TimelineEventPolicy < ::BasePolicy
delegate { @subject.incident }
2022-08-13 15:12:31 +05:30
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
2022-07-16 23:28:13 +05:30
end
end