2024-09-09 web, development, javascript

Postgres SQL commands

By 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);