{% extends "base.html" %} {% from "components/ui.html" import action, anywhere_tag, csrf_field, danger_card, empty with context %} {% from "components/grants.html" import grant_editor, grants_of, role_checks, role_tags %} {% block title %}{{ user.name }} · {{ APP_NAME }}{% endblock %} {% block heading %}{{ user.name }}{% endblock %} {% block subheading %}
{{ user.id }}
{% endblock %} {% block content %} {% if new_token %}

New token

shown this once

Copy it now. Only its hash is kept. It cannot be shown again.

{{ new_token }}
{% endif %}

Rights

{% if is_me %}you{% endif %} {% if user.disabled %}disabled{% else %}active{% endif %}
Roles
{{ role_tags(user.roles) }}
Grants
{{ grants_of(user.grants, names) }}

Effective rights

The grants of the user and of its roles together{% if user.disabled %}. They apply once the user is enabled again{% endif %}.
{% if effective.accounts %}
{% for row in effective.accounts %} {% endfor %}
AccountMaySending
{{ row.email }}{% for warning in row.warnings %}{{ anywhere_tag() }}{% endfor %} {% for group in row.groups %}{{ group }} {% endfor %}{% for operation in row.operations %}{{ operation }} {% endfor %} {% for limit in row.sending %}
{% if limit.recipients is none %}to anyone{% else %}to {{ limit.recipients | join(", ") }}{% endif %}, {% if limit.max_per_day is none %}no daily limit{% else %}at most {{ limit.max_per_day }} a day{% endif %}
{% else %}—{% endfor %}
{% else %}

No rights on any account you can see.

{% endif %}
{% if effective.groups or effective.operations %}
Beyond accounts
{% for group in effective.groups %}{{ group }} {% endfor %}{% for operation in effective.operations %}{{ operation }} {% endfor %}
{% endif %}
{% if can_list_tokens %}

Tokens

{{ tokens | length }}
{% 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 %}
{{ csrf_field() }}
{% endif %}
{% endif %} {% if can_update %}
{{ csrf_field() }}

Change

You can hand out only rights you hold yourself.
Access
{% if role_choices %}{{ role_checks(role_choices, user.roles) }}{% endif %}
{{ grant_editor(rows, account_choices, groups, group_ops) }}
{% 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 %}