Voltar à lição

Arquivo funcional original

policies.sql

O código e as páginas funcionais de exemplo mantêm seus identificadores e textos originais. A lição e as orientações dos arquivos explicam esses elementos no seu idioma.

create policy "upload own avatar" on storage.objects for insert to authenticated
with check (bucket_id='avatars' and (storage.foldername(name))[1]=auth.uid()::text);
create policy "read own avatar" on storage.objects for select to authenticated
using (bucket_id='avatars' and (storage.foldername(name))[1]=auth.uid()::text);