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: 375a553535984e89782e305199cbb7e0e04656c8 (plain)
1
2
3
4
5
6
7
8
9
class EnvironmentPolicy < BasePolicy
  delegate { @subject.project }

  condition(:stop_action_allowed) do
    @subject.stop_action? && can?(:update_build, @subject.stop_action)
  end

  rule { can?(:create_deployment) & stop_action_allowed }.enable :stop_environment
end