2018-07-24 06:00:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-18 13:40:39 -04:00
|
|
|
class DeploymentPolicy < BasePolicy
|
2017-04-06 17:06:42 -04:00
|
|
|
delegate { @subject.project }
|
2018-10-23 06:58:41 -04:00
|
|
|
|
|
|
|
condition(:can_retry_deployable) do
|
|
|
|
can?(:update_build, @subject.deployable)
|
|
|
|
end
|
|
|
|
|
|
|
|
rule { ~can_retry_deployable }.policy do
|
|
|
|
prevent :create_deployment
|
|
|
|
prevent :update_deployment
|
|
|
|
end
|
2016-08-18 13:40:39 -04:00
|
|
|
end
|