Welcome to mirror list, hosted at ThFree Co, Russian Federation.

alert_policy.rb « alert_management « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9b6ce72851cec582938b690181027e8454a31ceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module AlertManagement
  class AlertPolicy < ::BasePolicy
    delegate { @subject.project }

    rule { can?(:read_alert_management_alert) }.policy do
      enable :read_alert_management_metric_image
    end

    rule { can?(:update_alert_management_alert) }.policy do
      enable :upload_alert_management_metric_image
      enable :update_alert_management_metric_image
      enable :destroy_alert_management_metric_image
    end
  end
end