debian-mirror-gitlab/app/policies/environment_policy.rb

10 lines
272 B
Ruby
Raw Normal View History

2016-09-29 09:46:39 +05:30
class EnvironmentPolicy < BasePolicy
2017-09-10 17:25:29 +05:30
delegate { @subject.project }
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
condition(:stop_action_allowed) do
@subject.stop_action? && can?(:update_build, @subject.stop_action)
2017-08-17 22:00:37 +05:30
end
2017-09-10 17:25:29 +05:30
rule { can?(:create_deployment) & stop_action_allowed }.enable :stop_environment
2016-09-29 09:46:39 +05:30
end