Commit c433b191 authored by Stan Hu's avatar Stan Hu

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
parents 3dd22486 3cbaed97
...@@ -88,7 +88,7 @@ module API ...@@ -88,7 +88,7 @@ module API
user = User.find_by(id: params[:id]) user = User.find_by(id: params[:id])
not_found!('User') unless user && can?(current_user, :read_user, user) 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 present user, opts
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment