%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see .
%>
<% unless @read_only
account = @context && (@context.is_a?(Account) ? @context : @context.account)
# Note: we'd like to pick :allow_course_admin_actions or :manage_admin_users depending on
# whether or not the :granular_permissions_manage_users FF is on for the root account, but
# we need the permission in order to even figure out what the appropriate root account is.
# So in this case, we'll take either; this appears to be safe because the permission check
# is not used anywhere else in this view.
managed_accounts = @user.associated_root_accounts.select{|a| can_do(a, @current_user, :allow_course_admin_actions, :manage_admin_users) }
account ||= managed_accounts.first
root_account = account.root_account if account
end
%>
<% js_bundle :user_name %>
<% unless @read_only %>
<%= t('update_instructions', "You can update some of this user's information, but they can change it back if they choose.") %>