diff options
Diffstat (limited to 'app/policies/ci/bridge_policy.rb')
-rw-r--r-- | app/policies/ci/bridge_policy.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/policies/ci/bridge_policy.rb b/app/policies/ci/bridge_policy.rb new file mode 100644 index 00000000000..37a07ea8aaf --- /dev/null +++ b/app/policies/ci/bridge_policy.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Ci + class BridgePolicy < CommitStatusPolicy + condition(:can_update_downstream_branch) do + ::Gitlab::UserAccess.new(@user, container: @subject.downstream_project) + .can_update_branch?(@subject.target_revision_ref) + end + + rule { can_update_downstream_branch }.enable :play_job + end +end |