gitlab-org--gitlab-foss/app/policies/environment_policy.rb

10 lines
272 B
Ruby
Raw Normal View History

class EnvironmentPolicy < BasePolicy
delegate { @subject.project }
condition(:stop_action_allowed) do
@subject.stop_action? && can?(:update_build, @subject.stop_action)
2017-05-03 09:42:29 -04:00
end
rule { can?(:create_deployment) & stop_action_allowed }.enable :stop_environment
end