use @domain_root_account as the context for a bare /api/v1/users/self

fixes CORE-1458

test plan:
 * go to /api/v1/users/self; it should work

Change-Id: I0f929ebed3fb809d554c9476946a881124e62280
Reviewed-on: https://gerrit.instructure.com/151438
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Matt Miller <mmiller@instructure.com>
Tested-by: Jenkins
This commit is contained in:
Cody Cutrer 2018-05-24 15:50:54 -06:00
parent 838c654c68
commit aa8b0e3d1c
1 changed files with 1 additions and 1 deletions

View File

@ -1216,7 +1216,7 @@ class UsersController < ApplicationController
def api_show
@user = api_find(User, params[:id])
if @user.grants_right?(@current_user, session, :api_show_user)
render :json => user_json(@user, @current_user, session, %w{locale avatar_url permissions email}, @current_user.pseudonym.account)
render :json => user_json(@user, @current_user, session, %w{locale avatar_url permissions email}, @domain_root_account)
else
render_unauthorized_action
end