From 98d29f6e78526d9bc35233a1049a502294f56384 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 5 Jul 2018 15:46:39 +0300 Subject: Add ability to disable manifest import Signed-off-by: Dmitriy Zaporozhets --- app/controllers/application_controller.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 21cc6dfdd16..07089ada51d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -30,7 +30,13 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception, prepend: true helper_method :can? - helper_method :import_sources_enabled?, :github_import_enabled?, :gitea_import_enabled?, :github_import_configured?, :gitlab_import_enabled?, :gitlab_import_configured?, :bitbucket_import_enabled?, :bitbucket_import_configured?, :google_code_import_enabled?, :fogbugz_import_enabled?, :git_import_enabled?, :gitlab_project_import_enabled? + helper_method :import_sources_enabled?, :github_import_enabled?, + :gitea_import_enabled?, :github_import_configured?, + :gitlab_import_enabled?, :gitlab_import_configured?, + :bitbucket_import_enabled?, :bitbucket_import_configured?, + :google_code_import_enabled?, :fogbugz_import_enabled?, + :git_import_enabled?, :gitlab_project_import_enabled?, + :manifest_import_enabled? rescue_from Encoding::CompatibilityError do |exception| log_exception(exception) @@ -351,6 +357,10 @@ class ApplicationController < ActionController::Base Gitlab::CurrentSettings.import_sources.include?('gitlab_project') end + def manifest_import_enabled? + Gitlab::CurrentSettings.import_sources.include?('manifest') + end + # U2F (universal 2nd factor) devices need a unique identifier for the application # to perform authentication. # https://developers.yubico.com/U2F/App_ID.html -- cgit v1.2.1 From 6743147b7d9f310fbf5afa520e19ae495fd4df33 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 9 Jul 2018 14:59:07 +0300 Subject: Improve manifest feature after backend review Signed-off-by: Dmitriy Zaporozhets --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 07089ada51d..f45fcd4d900 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -358,7 +358,7 @@ class ApplicationController < ActionController::Base end def manifest_import_enabled? - Gitlab::CurrentSettings.import_sources.include?('manifest') + Group.supports_nested_groups? && Gitlab::CurrentSettings.import_sources.include?('manifest') end # U2F (universal 2nd factor) devices need a unique identifier for the application -- cgit v1.2.1