vienalatina/apps/board/templates
Pablo Volenski 1ff3522c56
A superadministrator above the responsable
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
2026-10-06 11:55:41 +00:00
..
_attachments.html Let members post pictures, and back them up 2026-09-28 09:02:18 +00:00
_person.html Private messages live on the person, not in a tab 2026-10-03 20:12:16 +00:00
_reaction.html Publishing has never worked: one line, two wrong answers 2026-09-30 14:39:14 +00:00
base.html Marca: the admin owns the look, logo included 2026-10-03 20:25:52 +00:00
brand_form.html Marca: the admin owns the look, logo included 2026-10-03 20:25:52 +00:00
calendar.html Two calendars: one for everybody, one for the members 2026-10-03 09:53:54 +00:00
comment_form.html The bar, the share card, the writing box and subpages 2026-10-02 15:21:35 +00:00
content_form.html A phone can use this site, and the way in is a button 2026-10-03 21:04:13 +00:00
content_list.html A phone can use this site, and the way in is a button 2026-10-03 21:04:13 +00:00
error.html One dashboard, five sections, and a moderation queue 2026-09-30 11:09:55 +00:00
event_form.html Two calendars: one for everybody, one for the members 2026-10-03 09:53:54 +00:00
event.html A phone can use this site, and the way in is a button 2026-10-03 21:04:13 +00:00
gestion.html A superadministrator above the responsable 2026-10-06 11:55:41 +00:00
home.html Private messages live on the person, not in a tab 2026-10-03 20:12:16 +00:00
login.html One front door: the members area owns its own logins 2026-09-29 08:25:25 +00:00
member_created.html One front door: the members area owns its own logins 2026-09-29 08:25:25 +00:00
member_new.html One dashboard, five sections, and a moderation queue 2026-09-30 11:09:55 +00:00
member.html A superadministrator above the responsable 2026-10-06 11:55:41 +00:00
members.html A superadministrator above the responsable 2026-10-06 11:55:41 +00:00
profile_edit.html The bar, the share card, the writing box and subpages 2026-10-02 15:21:35 +00:00
profile.html Style the profile page, and drop the step before writing 2026-09-29 14:16:25 +00:00
recover.html Refuse before the form, not after the password 2026-09-25 19:20:44 +00:00
set_password.html Refuse before the form, not after the password 2026-09-25 19:20:44 +00:00
submission_form.html A phone can use this site, and the way in is a button 2026-10-03 21:04:13 +00:00
submission.html A phone can use this site, and the way in is a button 2026-10-03 21:04:13 +00:00
submissions.html Private messages live on the person, not in a tab 2026-10-03 20:12:16 +00:00
thread_form.html The bar, the share card, the writing box and subpages 2026-10-02 15:21:35 +00:00
thread.html Private messages live on the person, not in a tab 2026-10-03 20:12:16 +00:00
threads.html Private messages live on the person, not in a tab 2026-10-03 20:12:16 +00:00