{% extends "base.html" %} {% from "components/ui.html" import action, anywhere_tag, breadcrumb, card, csrf_field, danger_card, empty, fact, facts, new_row, related, rights_tags, secret_card with context %} {% from "components/audit.html" import activity_rows %} {% from "components/grants.html" import grant_editor, grants_of, role_checks, role_tags, sending_of, service_editor, service_of %} {% block title %}{{ user.name }} · {{ APP_NAME }}{% endblock %} {% block heading %}{{ user.name }}{% endblock %} {% block subheading %}{{ breadcrumb([("Users", "/ui/users"), (user.name, None)]) }}{% endblock %} {% block content %} {% if new_token %} {% call secret_card("New token", new_token) %}Copy it now. Only its hash is kept. It cannot be shown again.{% endcall %} {% endif %} {% if new_password %} {% call secret_card("One-time password", new_password) %}Pass it to {{ user.name }} over a safe channel. It must be changed at the first sign-in.{% endcall %} {% endif %} {% set state %}{% if is_me %}you {% endif %}{% if not user.ui_sign_in %}API only {% endif %}{% if user.disabled %}disabled{% else %}active{% endif %}{% endset %} {% call facts("User", tags=state) %} {% call fact("Roles") %}{{ role_tags(user.roles) }}{% endcall %} {% call fact("Service rights") %}{{ service_of(user.service) }}{% endcall %} {% call fact("Grants") %}{{ grants_of(user.grants, names) }}{% endcall %} {% call fact("Sign-in to the UI") %}{% if not user.ui_sign_in %}off: an API user, tokens only{% elif sign_in.must_change %}with a password set for it, to change at the next sign-in{% elif sign_in.has_password %}with a password{% else %}not possible: no password yet{% endif %}{% endcall %} {{ fact("Last sign-in", sign_in.last_sign_in_at | when) }} {{ fact("Id", user.id, cls="mono") }} {% endcall %} {% call card("Effective rights", meta="The rights of the user and of its roles together" ~ (". They apply once the user is enabled again" if user.disabled else "") ~ ".", tight=True) %} {% if effective.accounts %}
{% for row in effective.accounts %} {% endfor %}
AccountMaySending
{{ row.email }}{% for warning in row.warnings %}{{ anywhere_tag() }}{% endfor %} {{ rights_tags(row.groups, row.operations) }} {{ sending_of(row.sending) }}
{% else %}

No rights on any account you can see.

{% endif %} {% if effective.groups or effective.operations %}
Of the service
{{ rights_tags(effective.groups, effective.operations) }}
{% endif %} {% endcall %} {% if can_list_tokens %} {% call related("Tokens", count=tokens | length, meta="for the API and the MCP server") %}
{% if tokens %}
{% for token, state in tokens %} {% endfor %}
NameCreatedExpiresLast usedState
{{ token.name }}{{ token.id[:16] }}… {{ token.created_at | when }} {{ token.expires_at | when }} {{ token.last_used_at | when }} {% if state == "active" %}active{% else %}{{ state }}{% endif %} {% if can_revoke and state == "active" %}{{ action("/ui/users/" ~ user.id ~ "/tokens/" ~ token.id ~ "/revoke", "Revoke", confirm="Revoke the token " ~ token.name ~ "? Whoever uses it is locked out at once.", cls="small danger") }}{% endif %}
{% else %}{{ empty("No token yet.") }}{% endif %}
{% if can_create_token %} {% call new_row("New token", open=not tokens or typed_token) %}
{{ csrf_field() }}
{% endcall %} {% endif %} {% endcall %} {% endif %} {% if activity is not none %} {% call related("Recent activity", meta="what this user did, newest first") %}
{% if activity %}{{ activity_rows(activity, outcomes, False, who=False) }}{% else %}{{ empty("Nothing in the audit.") }}{% endif %}
All its activity · What was done to it
{% endcall %} {% endif %} {% if can_update %}
{{ csrf_field() }} {% call card("Change", meta="You can hand out only rights you hold yourself.") %}
{% if not is_me %}
Access
{% endif %}
{% if role_choices %}{{ role_checks(role_choices, typed.roles if typed else user.roles) }}{% endif %}
Service rights {{ service_editor(service, service_names, service_ops) }}
Grants {{ grant_editor(rows, account_choices, groups, group_ops) }}
{% endcall %}
{% endif %} {% if is_me %} {% call card("Password") %}

Change your password

{% endcall %} {% elif can_set_password and user.ui_sign_in %} {% call card("Password", meta="Whoever sets a password can sign in as that user.") %}
{{ csrf_field() }} The service makes one and shows it once.
{{ csrf_field() }}
{{ user.name }} must change it at the next sign-in.
{% endcall %} {% endif %} {% if can_delete %} {{ danger_card("Delete", "Deletes the user and all its tokens. What it sent stays in the send audit.", "/ui/users/" ~ user.id ~ "/delete", "Delete user", "Delete " ~ user.name ~ " and its tokens?") }} {% endif %} {% endblock %}