From 3cbaed97f1c085647bffcf8a729b72bc2a52d59e Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Fri, 15 Sep 2017 19:34:52 -0400 Subject: Ensure we use `Entities::User` for non-admin `users/:id` API requests --- lib/api/users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/users.rb') 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