Skip to content
Snippets Groups Projects
Commit b04f9a9b authored by Alejandro Rodríguez's avatar Alejandro Rodríguez
Browse files

Fix merge conflicts after CE Upstream update

parent 36f255b2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -327,11 +327,7 @@ class ProjectsController < Projects::ApplicationController
 
def project_params
params.require(:project)
<<<<<<< HEAD
.permit(project_params_ce << project_params_ee)
=======
.permit(project_params_ce)
>>>>>>> ce/master
end
 
def project_params_ce
Loading
Loading
@@ -368,7 +364,6 @@ class ProjectsController < Projects::ApplicationController
wiki_access_level
]
]
<<<<<<< HEAD
end
 
def project_params_ee
Loading
Loading
@@ -385,8 +380,6 @@ class ProjectsController < Projects::ApplicationController
repository_size_limit
reset_approvals_on_push
]
=======
>>>>>>> ce/master
end
 
def repo_exists?
Loading
Loading
Loading
Loading
@@ -223,11 +223,6 @@ class Project < ActiveRecord::Base
scope :with_push, -> { joins(:events).where('events.action = ?', Event::PUSHED) }
scope :with_remote_mirrors, -> { joins(:remote_mirrors).where(remote_mirrors: { enabled: true }).distinct }
 
<<<<<<< HEAD
scope :with_builds_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.builds_access_level IS NULL or project_features.builds_access_level > 0') }
scope :with_issues_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.issues_access_level IS NULL or project_features.issues_access_level > 0') }
scope :with_wiki_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.wiki_access_level IS NULL or project_features.wiki_access_level > 0') }
=======
scope :with_project_feature, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id') }
 
# "enabled" here means "not disabled". It includes private features!
Loading
Loading
@@ -244,6 +239,7 @@ class Project < ActiveRecord::Base
 
scope :with_builds_enabled, -> { with_feature_enabled(:builds) }
scope :with_issues_enabled, -> { with_feature_enabled(:issues) }
scope :with_wiki_enabled, -> { with_project_feature(:wiki) }
 
# project features may be "disabled", "internal" or "enabled". If "internal",
# they are only available to team members. This scope returns projects where
Loading
Loading
@@ -260,7 +256,6 @@ class Project < ActiveRecord::Base
union = Gitlab::SQL::Union.new([unconditional.select(:id), authorized.select(:id)])
where(arel_table[:id].in(Arel::Nodes::SqlLiteral.new(union.to_sql)))
end
>>>>>>> ce/master
 
scope :active, -> { joins(:issues, :notes, :merge_requests).order('issues.created_at, notes.created_at, merge_requests.created_at DESC') }
scope :abandoned, -> { where('projects.last_activity_at < ?', 6.months.ago) }
Loading
Loading
Loading
Loading
@@ -23,12 +23,8 @@ module API
else
skip_ldap = params[:skip_ldap].present? && params[:skip_ldap] == 'true'
@users = User.all
<<<<<<< HEAD
@users = @users.active if params[:active].present?
@users = @users.non_ldap if skip_ldap
=======
@users = @users.active if to_boolean(params[:active])
>>>>>>> ce/master
@users = @users.non_ldap if skip_ldap
@users = @users.search(params[:search]) if params[:search].present?
@users = @users.blocked if to_boolean(params[:blocked])
@users = @users.external if to_boolean(params[:external]) && current_user.is_admin?
Loading
Loading
Loading
Loading
@@ -2,24 +2,9 @@
# class return an instance of `GitlabAccessStatus`
module Gitlab
class GitAccess
<<<<<<< HEAD
include PathLocksHelper
UnauthorizedError = Class.new(StandardError)
 
DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive }
PUSH_COMMANDS = %w{ git-receive-pack }
GIT_ANNEX_COMMANDS = %w{ git-annex-shell }
ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS + GIT_ANNEX_COMMANDS
ERROR_MESSAGES = {
upload: 'You are not allowed to upload code for this project.',
download: 'You are not allowed to download code from this project.',
deploy_key: 'Deploy keys are not allowed to push code.',
no_repo: 'A repository for this project does not exist yet.'
}
=======
UnauthorizedError = Class.new(StandardError)
ERROR_MESSAGES = {
upload: 'You are not allowed to upload code for this project.',
download: 'You are not allowed to download code from this project.',
Loading
Loading
@@ -29,8 +14,8 @@ module Gitlab
 
DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive }
PUSH_COMMANDS = %w{ git-receive-pack }
ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS
>>>>>>> ce/master
GIT_ANNEX_COMMANDS = %w{ git-annex-shell }
ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS + GIT_ANNEX_COMMANDS
 
attr_reader :actor, :project, :protocol, :user_access, :authentication_abilities
 
Loading
Loading
@@ -47,22 +32,16 @@ module Gitlab
check_active_user!
check_project_accessibility!
check_command_existence!(cmd)
<<<<<<< HEAD
 
check_geo_license!
=======
>>>>>>> ce/master
 
case cmd
when *DOWNLOAD_COMMANDS
download_access_check
when *PUSH_COMMANDS
push_access_check(changes)
<<<<<<< HEAD
when *GIT_ANNEX_COMMANDS
git_annex_access_check(project, changes)
=======
>>>>>>> ce/master
end
 
build_status_object(true)
Loading
Loading
@@ -73,11 +52,7 @@ module Gitlab
def download_access_check
if user
user_download_access_check
<<<<<<< HEAD
elsif deploy_key.nil? && geo_node_key.nil? && !Guest.can?(:download_code, project)
=======
elsif deploy_key.nil? && !Guest.can?(:download_code, project)
>>>>>>> ce/master
raise UnauthorizedError, ERROR_MESSAGES[:download]
end
end
Loading
Loading
@@ -125,7 +100,6 @@ module Gitlab
 
unless project.repository.exists?
raise UnauthorizedError, ERROR_MESSAGES[:no_repo]
<<<<<<< HEAD
end
 
if project.above_size_limit?
Loading
Loading
@@ -135,8 +109,6 @@ module Gitlab
if ::License.block_changes?
message = ::LicenseHelper.license_message(signed_in: true, is_admin: (user && user.is_admin?))
raise UnauthorizedError, message
=======
>>>>>>> ce/master
end
 
changes_list = Gitlab::ChangesList.new(changes)
Loading
Loading
@@ -149,7 +121,6 @@ module Gitlab
unless status.allowed?
# If user does not have access to make at least one change - cancel all push
raise UnauthorizedError, status.message
<<<<<<< HEAD
end
 
if project.size_limit_enabled?
Loading
Loading
@@ -160,10 +131,6 @@ module Gitlab
if project.changes_will_exceed_size_limit?(push_size_in_bytes.to_mb)
raise UnauthorizedError, Gitlab::RepositorySizeError.new(project).new_changes_error
end
=======
end
end
>>>>>>> ce/master
end
 
def change_access_check(change)
Loading
Loading
@@ -200,15 +167,12 @@ module Gitlab
end
end
 
<<<<<<< HEAD
def check_geo_license!
if Gitlab::Geo.secondary? && !Gitlab::Geo.license_allows?
raise UnauthorizedError, 'Your current license does not have GitLab Geo add-on enabled.'
end
end
 
=======
>>>>>>> ce/master
def matching_merge_request?(newrev, branch_name)
Checks::MatchingMergeRequest.new(newrev, branch_name, project).match?
end
Loading
Loading
@@ -255,11 +219,8 @@ module Gitlab
user_access.can_read_project?
elsif deploy_key
deploy_key_can_read_project?
<<<<<<< HEAD
elsif geo_node_key
true
=======
>>>>>>> ce/master
else
Guest.can?(:read_project, project)
end
Loading
Loading
Loading
Loading
@@ -101,13 +101,12 @@ module Gitlab
options['timeout'].to_i
end
 
<<<<<<< HEAD
def external_groups
options['external_groups']
=======
end
def has_auth?
options['password'] || options['bind_dn']
>>>>>>> ce/master
end
 
protected
Loading
Loading
Loading
Loading
@@ -20,11 +20,7 @@ describe Gitlab::GitAccessWiki, lib: true do
project.team << [user, :developer]
end
 
<<<<<<< HEAD
subject { access.check('git-receive-pack', changes) }
=======
subject { access.check('git-receive-pack', changes) }
>>>>>>> ce/master
 
it { expect(subject.allowed?).to be_truthy }
 
Loading
Loading
Loading
Loading
@@ -14,13 +14,8 @@ describe Gitlab::LDAP::Config, lib: true do
expect(config).to be_a described_class
end
 
<<<<<<< HEAD
it "raises an error if a unknow provider is used" do
expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error(Gitlab::LDAP::Config::InvalidProvider)
=======
it 'raises an error if a unknown provider is used' do
expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error(RuntimeError)
>>>>>>> ce/master
end
end
 
Loading
Loading
Loading
Loading
@@ -147,7 +147,6 @@ describe 'Git HTTP requests', lib: true do
end
end
end
<<<<<<< HEAD
end
 
context "when Kerberos token is provided" do
Loading
Loading
@@ -258,8 +257,6 @@ describe 'Git HTTP requests', lib: true do
expect(response).to have_http_status(403)
end
end
=======
>>>>>>> ce/master
end
 
context "when the project is private" do
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