## `avatar` (Public) In order to provide and save custom avatars uploaded by the users, create an public bucket called `avatars` and apply the following policies to `storage.objects` or directly to the bucket. ### Policies #### Select ```sql CREATE POLICY "Enable read access for all users" ON "storage"."objects" AS PERMISSIVE FOR SELECT TO authenticated USING (true) ``` #### Insert ```sql CREATE POLICY "Enable insert for authenticated users only" ON "storage"."objects" AS PERMISSIVE FOR INSERT TO authenticated WITH CHECK (true) ``` #### Update ```sql CREATE POLICY "Enable update for users based on uid" ON "storage"."objects" AS PERMISSIVE FOR UPDATE TO authenticated USING (auth.uid() = owner) WITH CHECK (auth.uid() = owner) ``` #### Delete ```sql CREATE POLICY "Enable delete for users based on user_id" ON "storage"."objects" AS PERMISSIVE FOR DELETE TO authenticated USING (auth.uid() = owner) ```