2016-08-18 17:40:39 +00:00
|
|
|
class EnvironmentPolicy < BasePolicy
|
2017-04-06 21:06:42 +00:00
|
|
|
delegate { @subject.project }
|
2017-05-01 11:38:57 +00:00
|
|
|
|
2017-04-06 21:06:42 +00:00
|
|
|
condition(:stop_action_allowed) do
|
|
|
|
@subject.stop_action? && can?(:update_build, @subject.stop_action)
|
2017-05-03 13:42:29 +00:00
|
|
|
end
|
2017-05-01 11:38:57 +00:00
|
|
|
|
2017-04-06 21:06:42 +00:00
|
|
|
rule { can?(:create_deployment) & stop_action_allowed }.enable :stop_environment
|
2016-08-18 17:40:39 +00:00
|
|
|
end
|