Is supabase store move working for you? I always ...
# javascript
e
Is supabase store move working for you? I always have a 400 error "the resource was not found". Even if I can find the image in the table editor and the storage database
b
have you allowed read for the storage bucket?
in the policies section?
e
yes I think so. If I list the images in the bucket folder, with the js library, I see my images
I also created the update policy
b
are u trying to update the images?
e
b
ah
e
the documentation mentions: ``objects permissions: update and select``
b
i had this error just a few hours ago
adding this fixed it for me
e
adding the both update and select permissions?
b
yes
the permissions for
move
&
update
is the same, so it should probably work for
move
e
I have that. Delete is working well and it's the same code for update. Do you see something I am missing?
thanks for your time to try to help me! 🙏
b
i think its here
i'm not too sure about the differences between bucket & object permission, but i think its here
e
your permissions apply to all buckets where I created permissions for this specific bucket
but I can try to add permissions globally, they may have a bug
can you share me the code of your update policy please?
b
Copy code
sql
CREATE POLICY "policy_name"
ON storage.objects
FOR UPDATE USING (
  auth.role() = 'authenticated'
) WITH CHECK (
  auth.role() = 'authenticated'
);
e
thanks!
b
ah i didn't realize
e
@User it worked with a global policy! Thanks a lot
b
nice!
@User hey i got this to work without the global permission:
Copy code
sql
create policy "give select access to folder for authenticated users" 
on storage.objects for select using (
  bucket_id = 'bucket' 
  and (storage.foldername(name))[1] = 'folder' 
  and auth.role() = 'authenticated'
);

create policy "give update access to folder for authenticated users" 
on storage.objects for update using (
  bucket_id = 'bucket' 
  and (storage.foldername(name))[1] = 'folder' 
  and auth.role() = 'authenticated'
);
e
ho nice, thanks!