gitlab-org--gitlab-foss/app/policies/environment_policy.rb
2017-06-27 12:44:37 -07:00

9 lines
272 B
Ruby

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