{# Unified permissions landing page — rendered at /admin/permissions in every consumer app that has HAS_PERMISSION_ADMIN = True. Replaces the old 404 and gives every app a visually consistent entry point into its capability matrix. Expected context: app_display_name : str — "Digi", "Beany", "Grind" auth_roles_url : str — deep link to Auth role admin, e.g. https://auth.coffeehouse.tools/admin/apps/digi/roles dimensions : list[dict] — one card per capability dimension: { "name": "Permissions", # human label "description": "...", # optional, shown under name "dept_url": "/admin/department-permissions", "role_url": "/admin/role-permissions", "simulate_url": "/admin/simulate-permissions", } stale_roles : list[str] — optional orphan slugs (banner rendered if any) cleanup_url : str — POST target for "Clean up" button csrf_token : str — CSRF token for the cleanup form #} {% extends "base.html" %}{% from "macros/i18n.html" import ch_t %} {% block title %}{{ ch_t("Permissions") }} · {{ app_display_name }}{% endblock %} {% block content %} {% set _manage = "Manage roles in Auth" %}{% if ch_i18n is defined and ch_i18n.translates(_manage) %}{% set _actions %}{{ ch_t("Manage roles in Auth") }} →{% endset %}{% else %}{% set _actions = 'Manage roles in Auth →' %}{% endif %}{% with page_title=ch_t("Permissions"), page_actions=_actions %} {% include "components/page_header.html" %} {% endwith %} {% set flashes = pop_flashes(request) if pop_flashes is defined else [] %} {% if flashes %} {% with flash_messages=flashes %} {% include "components/flash.html" %} {% endwith %} {% endif %} {% if stale_roles %} {% with stale_role_slugs=stale_roles, cleanup_url=cleanup_url, csrf_token=csrf_token %} {% include "components/stale_roles_banner.html" %} {% endwith %} {% endif %}

{%- set _use = "Use %(auth_link)s to create or edit roles themselves." %} {%- if ch_i18n is defined and ch_i18n.translates(_use) %} {{ ch_t("Capabilities this app offers, grouped by dimension.") }} {{ ch_t("Department baselines apply to everyone in a department; role grants/revokes layer on top.") }} {% set _link %}Auth{% endset -%} {{ ch_t("Use %(auth_link)s to create or edit roles themselves.", auth_link=_link) }} {%- else %} Capabilities this app offers, grouped by dimension. Department baselines apply to everyone in a department; role grants/revokes layer on top. Use Auth to create or edit roles themselves. {%- endif %}

{% for dim in dimensions %}

{{ dim.name }}

{% if dim.description %}

{{ dim.description }}

{% endif %}
{% endfor %}
{% endblock %}