Phase 12: share an event with co-hosts

The owner shares an event by email; a co-host gets full access inside it
but can't delete it or change who it's shared with. Shares are keyed by
email so an admin can be added before their first login, and RLS (not the
UI) is what enforces the owner-only parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-05 10:14:29 +02:00
co-authored by Claude Opus 5.5
parent 186a112b95
commit c27a3890f8
14 changed files with 353 additions and 27 deletions
+8 -2
View File
@@ -7,7 +7,7 @@ live scoreboard, and judges score from their phones via links. Versatile enough
## 2. Roles
| Role | Access | How they get in |
|---|---|---|
| **Admin** | Everything | Logs in (magic link). Email must be in `ADMIN_EMAILS`. |
| **Admin** | Everything in the events they own or co-host | Logs in (magic link). Email must be in `ADMIN_EMAILS`. |
| **Scoreboard viewer** | Read-only scoreboard for ONE event | Public link `/s/{scoreboardToken}` |
| **Judge** | Score ONE game | Personal link `/j/{judgeToken}` OR open game link `/jo/{openToken}` (enters name first) |
| **Team** | Buzz in for ONE team | Team buzzer link `/b/{buzzerToken}`, one per team for the whole night |
@@ -46,6 +46,12 @@ live scoreboard, and judges score from their phones via links. Versatile enough
- Revoke a judge (link stops working, their scores excluded).
- Share panel: scoreboard link + QR, all judge links per game, and one buzzer link + QR per team
(shown once any game uses buzzers).
- Co-hosts: the admin who created an event (its owner) shares it with other admins by email.
- The email must already be in `ADMIN_EMAILS`; it can be added before that admin's first login.
- A co-host sees the event in their list ("Shared with you") and can do everything in it —
setup, control room, scores — except delete it or change who it is shared with.
- The owner can remove a co-host at any time. Duplicating a shared event gives the co-host
their own copy, which they own.
### 4.2 Admin — Control room (`/admin/events/[id]/live`)
This is the screen used during the night. Must be fast and hard to mess up.
@@ -152,7 +158,7 @@ For "first to answer" games. A game opts in with the "Teams buzz in" checkbox.
## 6. Out of scope (v1)
- Individual contestants within teams (stretch: `participants` per team).
- Multiple admins / co-hosts (stretch).
- Transferring an event to another owner, and read-only co-hosts.
- Per-game timers (stretch). The event countdown timer is in 4.5; team buzzers are in 4.7.
- Buzzers for individual contestants, a configurable points value per correct answer, and
penalties for a wrong answer (use the bonus/penalty panel).