Skip to content

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

@miwelc

Description

@miwelc

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions