<%= @user.email_address %>

<% if @user.admin? %> Admin <% end %> <% case @user.status %> <% when "active" %> Active <% when "disabled" %> Disabled <% when "pending_invitation" %> Pending Invitation <% end %>
<% if @user.name.present? %>

<%= @user.name %>

<% end %>
<%= link_to "Edit", edit_admin_user_path(@user), class: "rounded-md bg-white dark:bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-900 dark:text-gray-200 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600" %>

Group memberships (<%= @user.groups.count %>)

<% if @user.groups.any? %>
    <% @user.groups.order(:name).each do |group| %>
  • <%= group.name %>

    <% if group.admin? %> Admin <% end %> <% if group.auto_assign? %> Auto Assign <% end %>
    <%= link_to "View", admin_group_path(group), class: "text-blue-600 hover:text-blue-900 text-sm" %>
  • <% end %>
<% else %>

This user is in no groups.

<% end %>

Accessible applications (<%= @accessible_applications.count %>)

<% unless @user.active? %>

User is <%= @user.status.humanize.downcase %> — access is denied regardless of group memberships.

<% end %> <% if @accessible_applications.any? %>
    <% @accessible_applications.each do |app| %> <% via = app.allowed_groups & @user.groups %>
  • <%= app.name %>

    <% via.each do |g| %> via <%= g.name %> <% end %>
    <%= link_to "View", admin_application_path(app), class: "text-blue-600 hover:text-blue-900 text-sm" %>
  • <% end %>
<% else %>

No accessible applications. Add the user to a group that's attached to one or more applications.

<% end %>