You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Photos live in two public buckets, events-images and team-images. Anyone can view them (that's what the site needs), but there are no upload policies yet, so uploads only work from the Supabase dashboard.
To do (migration in supabase/migrations/)
Policies on storage.objects for both buckets: insert, update and delete only when is_admin().
Leave public viewing as it is.
Good to know
The tables store the full public URL, for example https://<project>.supabase.co/storage/v1/object/public/events-images/<file>. Keep it that way so the live site keeps working.
Team photos are currently named by a uuid. Event photos use the original file name. Going forward, prefer <uuid>.<ext> for both so names never clash.
Done when
An admin can upload, replace and delete a file in both buckets from the app
A non-admin or signed-out user gets an error trying the same
Closing as done. This was implemented in #224, which added supabase/migrations/20261119100000_admin_image_uploads.sql. The migration was applied to the live LCS-Site project on 2026-11-19.
What's live now on storage.objects for events-images and team-images:
Upload, replace and delete: only when public.is_admin() is true. Signed-out and non-admin users are refused by the database itself.
Read through the API: admins only. This is needed so the storage API can replace (upsert) and delete files.
Public viewing: unchanged. Both buckets are still public, so every existing photo URL on lauriercs.org keeps loading (11 event and 28 team images).
There were no other storage policies before this. The old temporary upload rules had already been dropped, so nothing broader overrides these.
The "an admin can upload from the app" check gets tested for real in #211 and #214, when the upload UI lands.
Activity
Flapjacck commentedon Nov 19, 2026
Closing as done. This was implemented in #224, which added
supabase/migrations/20261119100000_admin_image_uploads.sql. The migration was applied to the live LCS-Site project on 2026-11-19.What's live now on
storage.objectsforevents-imagesandteam-images:public.is_admin()is true. Signed-out and non-admin users are refused by the database itself.There were no other storage policies before this. The old temporary upload rules had already been dropped, so nothing broader overrides these.
The "an admin can upload from the app" check gets tested for real in #211 and #214, when the upload UI lands.