Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bridge_policy.rb « ci « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f9e8eab08a29013909ea1133b0ee7d16809c6dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

module Ci
  class BridgePolicy < CommitStatusPolicy
    include Ci::DeployablePolicy

    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