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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/import_github.rb')
-rw-r--r--lib/api/import_github.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/import_github.rb b/lib/api/import_github.rb
index 21d4928193e..f31cc15dc62 100644
--- a/lib/api/import_github.rb
+++ b/lib/api/import_github.rb
@@ -4,6 +4,10 @@ module API
class ImportGithub < Grape::API
rescue_from Octokit::Unauthorized, with: :provider_unauthorized
+ before do
+ forbidden! unless Gitlab::CurrentSettings.import_sources&.include?('github')
+ end
+
helpers do
def client
@client ||= Gitlab::LegacyGithubImport::Client.new(params[:personal_access_token], client_options)