
CREATE POLICY "photos own read" ON storage.objects FOR SELECT TO authenticated
USING (bucket_id = 'mold-photos' AND ((storage.foldername(name))[1] = auth.uid()::text OR public.has_role(auth.uid(),'admin')));
CREATE POLICY "photos own insert" ON storage.objects FOR INSERT TO authenticated
WITH CHECK (bucket_id = 'mold-photos' AND ((storage.foldername(name))[1] = auth.uid()::text OR public.has_role(auth.uid(),'admin')));
CREATE POLICY "photos own delete" ON storage.objects FOR DELETE TO authenticated
USING (bucket_id = 'mold-photos' AND ((storage.foldername(name))[1] = auth.uid()::text OR public.has_role(auth.uid(),'admin')));
