Commit 3cbaed97 authored by Robert Speicher's avatar Robert Speicher

Ensure we use `Entities::User` for non-admin `users/:id` API requests

parent 3dd22486
...@@ -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