storage icon indicating copy to clipboard operation
storage copied to clipboard

Can't use `user_metadata` in RLS policies when uploading a file

Open miwelc opened this issue 5 months ago • 0 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I can't use custom values in user_metadata in RLS policies because they are not available in that context. From what I've read it's because storage.can_insert_object(...) is not being called with user_metadata and so it doesn't fake insert that info.

To Reproduce

Create a RLS policy that just checks any value in user_metadata.

Expected behavior

I can access in the RLS policy the custom values I defined during the upload call.

System information

  • OS: macOs
  • Browser (if applies):
  • Version of supabase-js: 2.56.0
  • Version of Node.js: 22.12

miwelc avatar Sep 08 '25 17:09 miwelc