RLS in Supabase vector embeddings (default document loader)

When adding data to the embeddings documents table in Supabase this table does not have Row Level Security on by default. However, after adding a uuid column to the documents table in Supabase I don’t see the option in n8n to add the user id to the rows that I feed to the table. We have the option to pass the content/data and metadata properties but not a uuid (user id) so that each user can only search the data he/she is allowed to see. How do I approach this best? If from an iOS app users can submit data that they should lateran be able to search through the use of embeddings, how do I make sure they can only retrieve their own data and not the data of other users? I should be able to pass the user id when submitting data to the documents table but I don’t see how.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

So I just figured it out. I have to add my user id to the metadata and refer with my rls policy to the metadata instead of the uid column.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.