{% 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 %}
| Account | May | Sending |
|---|---|---|
| {{ row.email }}{% for warning in row.warnings %}{{ anywhere_tag() }}{% endfor %} | {{ rights_tags(row.groups, row.operations) }} | {{ sending_of(row.sending) }} |
No rights on any account you can see.
{% endif %} {% if effective.groups or effective.operations %}| Name | Created | Expires | Last used | State | |
|---|---|---|---|---|---|
| {{ 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 %} |