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:
1 parent
a2b87602b4
commit
d4e4637e7c
13 files changed
+334
-30
No files matched your search
@@ -538,9 +538,12 @@ export async function removeSessionMaterial(sessionId: string): Promise<void> {
|
||||
if (error) throw new ApiError(error.message);
|
||||
}
|
||||
|
||||
export function sessionMaterialUrl(path: string): string {
|
||||
const { data } = supabase.storage.from('materials').getPublicUrl(path);
|
||||
return data.publicUrl;
|
||||
/** Open a session material in a new tab via a short-lived signed URL. The
|
||||
* materials bucket is private; storage RLS always allows admins. */
|
||||
export async function openSessionMaterial(path: string): Promise<void> {
|
||||
const { data, error } = await supabase.storage.from('materials').createSignedUrl(path, 600);
|
||||
if (error) throw new ApiError(error.message);
|
||||
window.open(data.signedUrl, '_blank');
|
||||
}
|
||||
|
||||
async function feedbackSidecarFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
|
||||
Reference in new issue
Block a user