{% extends "admin/_layout.html" %} {% from "_macros.html" import icon %} {% set section = "groups" %} {% block title %}{{ t("Groups & permissions") }} - {{ brand.name }}{% endblock %} {% block heading %}{{ t("Groups & permissions") }}{% endblock %} {% block admin_content %}

{{ tm("Permissions are a union: everyone starts with the baseline below, and each group they belong to can add more. A group never takes something away, so being in a second group can only widen what someone can do — which is what keeps “why can this person not do X?” answerable without simulating every group they are in. Administrators bypass all of it.") }}

{% if saved %}
{{ icon("check", "icon--sm") }} {{ saved }}
{% endif %}

{{ t("Baseline permissions") }}

{{ t("What every signed-in user can do before any group is considered. Turn something off here and grant it through a group to make it opt-in.") }}

{% for section_name, defs in permission_groups.items() %}
{{ t(section_name) }} {% for definition in defs %} {% endfor %}
{% endfor %}

{{ t("Groups") }} {{ groups|length }}

{# Rows, not a form each. The old page rendered every group's full permission grid, every member and every model on one screen -- fine for two groups and unreadable at ten, which is the list-plus-detail rule the model admin already follows. #}
{% for group in groups %}
{{ group.name }} {% if group.description %} {{ group.description }} {% endif %}
{{ t("1 member") if group.users|length == 1 else t("%(n)s members", n=group.users|length) }} {% if granted[group.id] %} {{ t("+1 permission") if granted[group.id] == 1 else t("+%(n)s permissions", n=granted[group.id]) }} {% endif %} {% if group.limits_json %}{{ t("quotas") }}{% endif %}
{% else %}

{{ t("No groups yet. Everybody gets the baseline above and nothing more.") }}

{% endfor %}
{% endblock %}