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