feat(sessions): material downloads unlock when the session ends

Private materials bucket + RLS read gate (admins/own speakers anytime, all
attendees after the scheduled slot end, event-local Amsterdam time); always
visible uploaded-state, locked download panel, authenticated client downloads,
admin signed URLs. 12 new assertions in material_time_lock_tests.sql.
This commit is contained in:
Lago committed 2026-10-21 18:57:15 +02:00
1 parent a2b87602b4
commit d4e4637e7c
13 files changed
+334 -30

No files matched your search

+8 -3
View File
@@ -213,9 +213,14 @@ the agenda list, its slot count, and Home's Now/Next cards all agree.
and no material is uploaded yet, a **non-dismissible** "📎 Upload your session
material" notice with a file input. Uploading stores the file in the
`materials` bucket and calls `set_session_material` (via
`uploadSessionMaterial`). Once uploaded, the notice is gone and a **📎
Download material** button appears (visible to **all** attendees), pinned to
the **bottom** of the sheet's button stack (below "Pick this session").
`uploadSessionMaterial`). Once uploaded, the notice is gone. Attendees
**always see that material exists** (📎 on the agenda card, and in the
sheet), but downloads **unlock when the session ends**: before `slot end`
non-speakers see a "📎 Material uploaded — unlocks at HH:MM" panel
(`material-locked`), after it (or as the session's speaker) a **📎
Download material** button (`downloadSessionMaterial`, authenticated
storage — the private bucket's RLS enforces the same rule server-side;
attendance is irrelevant, only the clock).
- **Remove material** — a speaker of the session can also **🗑 Remove material**
(to re-upload). This deletes the storage object and clears `material_path` via
`set_session_material` (null) — `removeSessionMaterial`.