summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /lib/api/projects.rb
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 83c335a3248..3b1d239398f 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -157,6 +157,8 @@ module API
[options[:with].prepare_relation(projects, options), options]
end
+ Preloaders::UserMaxAccessLevelInProjectsPreloader.new(records, current_user).execute if current_user
+
present records, options
end
@@ -608,6 +610,10 @@ module API
users = users.search(params[:search]) if params[:search].present?
users = users.where_not_in(params[:skip_users]) if params[:skip_users].present?
+ if Feature.enabled?(:sort_by_project_users_by_project_authorizations_user_id, user_project, default_enabled: :yaml)
+ users = users.order('project_authorizations.user_id' => :asc) # rubocop: disable CodeReuse/ActiveRecord
+ end
+
present paginate(users), with: Entities::UserBasic
end