debian-mirror-gitlab/app/policies/deployment_policy.rb

15 lines
305 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2016-09-29 09:46:39 +05:30
class DeploymentPolicy < BasePolicy
2017-09-10 17:25:29 +05:30
delegate { @subject.project }
2018-12-13 13:39:08 +05:30
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-09-29 09:46:39 +05:30
end