debian-mirror-gitlab/app/policies/environment_policy.rb
2017-09-10 17:25:29 +05:30

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