You asked for a super-admin, and most of it already existed as the `owner` role
— labelled «Responsable», seeded from BOARD_OWNER, already the only account that
could create an admin, demote one, erase anybody or hand the role on, with a
partial unique index making "exactly one" a database rule. You chose a genuine
fifth tier anyway, and there is a reading in which that is the better answer, so
this builds it with that reading made explicit:
superadministrador — the platform: admin accounts, the look, the identity
responsable — the association: members, moderators, invitations
The split is worth more than a rename because of where this is going. Installed
for a second organisation, the superadministrator is whoever maintains the box
and the responsable is their president — so the responsable chair is safe to
hand to a customer, and an admin account is not theirs to grant.
Both chairs are unreachable, for different reasons. The superadministrator
because there is nothing above them. The responsable because the chair belongs
to the association: a platform administrator quietly removing the president of
the organisation they host is exactly the move two chairs exist to prevent.
Each steps down by handing their own chair on, and whoever gives one up becomes
an administrator — there is no role above the one they just gave away.
Migration 7 is the rebuild migration 4 already did, for the same reason (SQLite
cannot alter a CHECK), and it promotes the existing owner — Pablo — to
superadministrator, leaving the responsable chair empty for the association to
fill. Nothing is erased; you offered and it was not needed.
Two things in here would have shipped silently without a test looking for them:
`_seed_superadmin` ends `ON CONFLICT(gitea_login) DO UPDATE SET role = …`. That
line was right while owner was the top of the tree. Left as it was, it would
have matched BOARD_OWNER's login and demoted the superadministrator back to
owner **on every container restart** — a privilege reduction caused by nothing
anybody did, freeing the chair for somebody else. It takes a second start-up to
catch, so the test starts the app three times.
And seven places outside the role modules asked "is this person at least an
admin" as a literal `("owner", "admin")` tuple — the wall's delete, the editor's
page collection, the calendar's edit flag, the dashboard, the moderation
predicate. Every one of them silently excluded the superadministrator the moment
a tier appeared above owner. They are now one ordered LADDER and one
`is_at_least`, so the next tier is a word in a list rather than an audit.
Marca moves from admin-only to superadmin-only, which is the distinction you
asked for: the look and the identity are the platform's.
564 tests pass, including the predicate table per actor and target, each of the
four doors into "make an admin" closed against an admin and against the
responsable, and both single-chair indexes surviving the rebuild.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
83 lines
2.7 KiB
HTML
83 lines
2.7 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Gestión{% endblock %}
|
|
|
|
{% block main %}
|
|
<div class="feed-head">
|
|
<h1>Gestión</h1>
|
|
</div>
|
|
|
|
<p class="muted">
|
|
Lo que sólo hace la administración. Todo lo demás — el muro, los privados,
|
|
las publicaciones — está en las otras secciones y funciona igual para ti que
|
|
para cualquier miembro.
|
|
</p>
|
|
|
|
<section class="panel">
|
|
<div class="panel__head">
|
|
<h2>Miembros</h2>
|
|
<a class="linkish" href="{{ url_for('members.new') }}">Dar de alta</a>
|
|
</div>
|
|
<p class="panel__row">
|
|
{{ counts.members }} en total · {{ counts.moderators }} pueden moderar
|
|
{% if counts.suspended %} · {{ counts.suspended }} suspendido{{ '' if counts.suspended == 1 else 's' }}{% endif %}
|
|
</p>
|
|
<p class="muted small">
|
|
El directorio está en <a href="{{ url_for('members.index') }}">Miembros</a>,
|
|
que ahora es una sección como las demás. Invitar de nuevo, cambiar el rol,
|
|
suspender y eliminar están en la ficha de cada persona.
|
|
</p>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="panel__head">
|
|
<h2>Artículos publicados</h2>
|
|
<a class="linkish" href="{{ url_for('content.index', collection='post') }}">Abrir</a>
|
|
</div>
|
|
<p class="muted small">
|
|
Lo que ya está en vienalatina.com: editar, corregir o retirar. Para
|
|
publicar algo nuevo, o para revisar lo que proponen los miembros, está
|
|
<a href="{{ url_for('submissions.index') }}">Publicaciones</a>.
|
|
</p>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="panel__head">
|
|
<h2>Páginas del sitio</h2>
|
|
<a class="linkish" href="{{ url_for('content.index', collection='page') }}">Abrir</a>
|
|
</div>
|
|
<p class="muted small">
|
|
Acerca de, contacto y las demás páginas fijas de vienalatina.com. Las
|
|
publicaciones no están aquí: eso es
|
|
<a href="{{ url_for('submissions.index') }}">Publicaciones</a>, que los
|
|
moderadores comparten contigo.
|
|
</p>
|
|
</section>
|
|
|
|
{% if g.member.role == 'superadmin' %}
|
|
<section class="panel">
|
|
<div class="panel__head">
|
|
<h2>Marca</h2>
|
|
<a class="linkish" href="{{ url_for('brand.edit') }}">Abrir</a>
|
|
</div>
|
|
{% if brand.updated_at and not brand.published_at %}
|
|
<p class="panel__row">Hay cambios guardados que no han llegado al sitio público.</p>
|
|
{% endif %}
|
|
<p class="muted small">
|
|
Los colores, el logotipo y el icono de la pestaña, para las dos mitades del
|
|
sitio. Con un apartado avanzado para quien sepa CSS, y un botón para
|
|
volver a lo de fábrica.
|
|
</p>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{% if counts.pending %}
|
|
<section class="panel panel--attention">
|
|
<div class="panel__head">
|
|
<h2>Pendiente de revisar</h2>
|
|
<a class="linkish" href="{{ url_for('submissions.index') }}">Ver</a>
|
|
</div>
|
|
<p class="panel__row">{{ counts.pending }} propuesta{{ '' if counts.pending == 1 else 's' }} esperando a un moderador.</p>
|
|
</section>
|
|
{% endif %}
|
|
{% endblock %}
|