From 00fe6307ab89443b3fbca8ee42df3b02c1b5cbd8 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 16 Sep 2017 01:08:27 +0000 Subject: Merge branch 'rs-default-user-entity' into 'master' Ensure we use `Entities::User` for non-admin `users/:id` API requests See merge request gitlab-org/gitlab-ce!14314 --- lib/api/users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/users.rb b/lib/api/users.rb index 1825c90a23b..bdebda58d3f 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -88,7 +88,7 @@ module API user = User.find_by(id: params[:id]) not_found!('User') unless user && can?(current_user, :read_user, user) - opts = current_user&.admin? ? { with: Entities::UserWithAdmin } : {} + opts = current_user&.admin? ? { with: Entities::UserWithAdmin } : { with: Entities::User } present user, opts end -- cgit v1.2.1