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>2021-06-16 21:25:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 21:25:58 +0300
commita5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch)
treefb69158581673816a8cd895f9d352dcb3c678b1e /lib/gitlab/project_search_results.rb
parentd16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff)
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'lib/gitlab/project_search_results.rb')
-rw-r--r--lib/gitlab/project_search_results.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb
index 6719dc8362b..e52023c4612 100644
--- a/lib/gitlab/project_search_results.rb
+++ b/lib/gitlab/project_search_results.rb
@@ -43,9 +43,20 @@ module Gitlab
end
end
+ # rubocop:disable CodeReuse/ActiveRecord
def users
- super.where(id: @project.team.members) # rubocop:disable CodeReuse/ActiveRecord
+ results = super
+
+ if @project.is_a?(Array)
+ team_members_for_projects = User.joins(:project_authorizations).where(project_authorizations: { project_id: @project })
+ results = results.where(id: team_members_for_projects)
+ else
+ results = results.where(id: @project.team.members)
+ end
+
+ results
end
+ # rubocop:enable CodeReuse/ActiveRecord
def limited_blobs_count
@limited_blobs_count ||= blobs(limit: count_limit).count