add conditional for view mode

Resolves #830 by checking for the existence of params[:user][:role] before setting params[:user][:view_mode] to it.