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

environment_policy.rb « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c0c9bbf2d9e9d347fec97321ccdf97343fea9577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class EnvironmentPolicy < BasePolicy
  alias_method :environment, :subject

  def rules
    delegate! environment.project

    if environment.stop_action?
      delegate! environment.stop_action
    end

    if can?(:create_deployment) && can?(:play_build)
      can! :stop_environment
    end
  end
end