Skip to content
Snippets Groups Projects
Commit be221a30 authored by Patricio Cano's avatar Patricio Cano
Browse files

Revert back to not defining a default Git access protocol.

parent cb24650a
No related branches found
No related tags found
1 merge request!4696Add setting that allows admins to choose which Git access protocols are enabled.
Loading
Loading
@@ -12,7 +12,7 @@ module BranchesHelper
def can_push_branch?(project, branch_name)
return false unless project.repository.branch_exists?(branch_name)
 
::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(branch_name)
::Gitlab::GitAccess.new(current_user, project, 'web').can_push_to_branch?(branch_name)
end
 
def project_branches
Loading
Loading
Loading
Loading
@@ -481,7 +481,7 @@ class MergeRequest < ActiveRecord::Base
end
 
def can_be_merged_by?(user)
::Gitlab::GitAccess.new(user, project).can_push_to_branch?(target_branch)
::Gitlab::GitAccess.new(user, project, 'web').can_push_to_branch?(target_branch)
end
 
def mergeable_ci_state?
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ module Commits
private
 
def check_push_permissions
allowed = ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(@target_branch)
allowed = ::Gitlab::GitAccess.new(current_user, project, 'web').can_push_to_branch?(@target_branch)
 
unless allowed
raise ValidationError.new('You are not allowed to push into this branch')
Loading
Loading
Loading
Loading
@@ -43,7 +43,7 @@ module Files
end
 
def validate
allowed = ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(@target_branch)
allowed = ::Gitlab::GitAccess.new(current_user, project, 'web').can_push_to_branch?(@target_branch)
 
unless allowed
raise_error("You are not allowed to push into this branch")
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ module Gitlab
 
attr_reader :actor, :project, :protocol
 
def initialize(actor, project, protocol = 'web')
def initialize(actor, project, protocol)
@actor = actor
@project = project
@protocol = protocol
Loading
Loading
require 'spec_helper'
 
describe Gitlab::GitAccess, lib: true do
let(:access) { Gitlab::GitAccess.new(actor, project) }
let(:access) { Gitlab::GitAccess.new(actor, project, 'web') }
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:actor) { user }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment