use api_find for UsersController#api_show
fixes CNVS-21714 test plan: * go to /api/v1/users/sis_user_id:theusersisid * it should not give a 404 (assuming you're logged in as an admin, and the id is valid) Change-Id: I0901f5c60941c1b3d27aa3a699c3bed20b0850cd Reviewed-on: https://gerrit.instructure.com/57746 Tested-by: Jenkins Reviewed-by: Mike Nomitch <mnomitch@instructure.com> QA-Review: Jeremy Putnam <jeremyp@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
8b76da7df9
commit
32ab5e7679
|
@ -1018,7 +1018,7 @@ class UsersController < ApplicationController
|
|||
#
|
||||
# @returns User
|
||||
def api_show
|
||||
@user = params[:id] && params[:id] != 'self' ? User.find(params[:id]) : @current_user
|
||||
@user = params[:id] && params[:id] != 'self' ? api_find(User, params[:id]) : @current_user
|
||||
if @user.grants_any_right?(@current_user, session, :manage, :manage_user_details)
|
||||
render :json => user_json(@user, @current_user, session, %w{locale avatar_url permissions}, @current_user.pseudonym.account)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue