gitlab-org--gitlab-foss/app/policies/deployment_policy.rb
Kamil Trzciński 40397f3577 Allow to make builds soft-archived.
The soft-archived builds cannot be run after some deadline time.
The intent is to aggressively recycle old builds after sometime.
2018-11-05 15:51:57 +01:00

14 lines
305 B
Ruby

# frozen_string_literal: true
class DeploymentPolicy < BasePolicy
delegate { @subject.project }
condition(:can_retry_deployable) do
can?(:update_build, @subject.deployable)
end
rule { ~can_retry_deployable }.policy do
prevent :create_deployment
prevent :update_deployment
end
end