app/controllers/admin/users_controller.rb
def another_user_access
    @user = User.find(params[:id])
    return if !@user.nil? && @user != current_user

    @user = nil
    render nothing: true, status: 403
  end
# Sets the @user instance variable if the current user is different from the
# one specified in params[:id]. Moreover, if the current user is the same as
# the targeted one, then a 403 response is rendered.
Sets the @user instance variable if the current user is different from the
one specified in params[:id]. Moreover, if the current user is the same as
the targeted one, then a 403 response is rendered.
Sets the @user instance variable if the current user is different from the one specified in params [ : id ] . Moreover if the current user is the same as the targeted one then a 403 response is rendered .
def another_user_access
    @user = User.find(params[:id])
    return if !@user.nil? && @user != current_user
    @user = nil
    render nothing: true, status: 403
  end
def another_user_access @user = User . find ( params [ :id ] ) return if ! @user . nil? && @user != current_user @user = nil render nothing : true , status : 403 end
Sets the @user instance variable if the current user is different from the
one specified in params[:id].
Sets the @user instance variable if the current user is different from the one specified in params [ : id ] .