gitlab-org--gitlab-foss/app/policies/deployment_policy.rb

15 lines
305 B
Ruby
Raw Normal View History

# 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