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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /lib/api/search.rb
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'lib/api/search.rb')
-rw-r--r--lib/api/search.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/api/search.rb b/lib/api/search.rb
index cf6a1385783..2204437f2ec 100644
--- a/lib/api/search.rb
+++ b/lib/api/search.rb
@@ -59,8 +59,13 @@ module API
end
def search(additional_params = {})
+ search_service = search_service(additional_params)
+ if search_service.global_search? && !search_service.global_search_enabled_for_scope?
+ forbidden!('Global Search is disabled for this scope')
+ end
+
@search_duration_s = Benchmark.realtime do
- @results = search_service(additional_params).search_objects(preload_method)
+ @results = search_service.search_objects(preload_method)
end
set_global_search_log_information(additional_params)
@@ -68,7 +73,7 @@ module API
Gitlab::Metrics::GlobalSearchSlis.record_apdex(
elapsed: @search_duration_s,
search_type: search_type(additional_params),
- search_level: search_service(additional_params).level,
+ search_level: search_service.level,
search_scope: search_scope
)