Skip to content

Commit db37bcd

Browse files
docs(org-avatar): correct avatars bucket RLS reconciliation note
These are the only write policies on the avatars bucket. Under deny-by-default RLS, a non-numeric (e.g. uuid-keyed) path is simply denied for insert/update/delete — it does not fall through to another policy, because none exists. No user_profile avatar upload path exists in the codebase today.
1 parent db011fd commit db37bcd

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

supabase/migrations/20260604120000_avatars_bucket_rls.sql

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414
-- * Each policy is `drop ... if exists` first so this migration coexists with
1515
-- any same-named policy that may already be present on the prod bucket and
1616
-- is safe to (re)apply.
17-
-- * The bucket is shared with non-org (e.g. user_profile, uuid-keyed) avatar
18-
-- objects. The membership check is wrapped in a CASE so a non-numeric first
19-
-- segment yields `false` instead of raising on the `::bigint` cast — those
20-
-- objects fall through to whatever policy governs them, never to an error.
17+
-- * These are the ONLY write policies on the `avatars` bucket. The membership
18+
-- check is wrapped in a CASE so a non-numeric first segment yields `false`
19+
-- instead of raising on the `::bigint` cast. Because storage.objects is
20+
-- deny-by-default under RLS and no other write policy exists, a non-numeric
21+
-- (e.g. uuid-keyed) path is simply DENIED for insert/update/delete — it does
22+
-- not "fall through" to anything. Org avatar objects live at
23+
-- `{organization_id}/avatar`; only that numeric-prefixed shape is writable
24+
-- here today. Reads stay public (see the public-read policy below).
2125

2226
insert into storage.buckets (id, name, public)
2327
values ('avatars', 'avatars', true)

0 commit comments

Comments
 (0)