-
Notifications
You must be signed in to change notification settings - Fork 0
Storage
Thorben edited this page Nov 21, 2022
·
1 revision
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.
CREATE POLICY "Enable read access for all users" ON "storage"."objects"
AS PERMISSIVE FOR SELECT
TO authenticated
USING (true)
CREATE POLICY "Enable insert for authenticated users only" ON "storage"."objects"
AS PERMISSIVE FOR INSERT
TO authenticated
WITH CHECK (true)
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)
CREATE POLICY "Enable delete for users based on user_id" ON "storage"."objects"
AS PERMISSIVE FOR DELETE
TO authenticated
USING (auth.uid() = owner)