web,development,javascript

Postgres SQL commands

April 13, 2024

O. Wolfson

Create a policy that allows authenticated users to write to the avatars bucket.

sql
CREATE POLICY "AllowAuthenticatedWritesToAvatars"
ON storage.objects FOR INSERT
WITH CHECK (auth.uid() IS NOT NULL AND bucket_id = 'avatars'::text);