Supabase Array field update failures

I have a Supabase table that contains an array column called “invites”. It’s a basic array of text values. I’m trying to use the UPDATE function in a workflow to provide a new array as the new value for that field, but I’m getting that the “new row violates the row-level security” issue.

I can update non-array fields, so I don’t think it’s actually an RLS problem though… Has anyone seen something like this?

image

Thanks,

Peter

You might want to add select and update permissions on the table. I’d need to see the RLS and your table setup to tell more.

I’m also not convinced it’s actually the RLS, because without changing the RLS rules, I CAN update the name field…

image
image

I’m thinking it’s something about the way that I’m providing the new array for the [invites] value that it’s causing some kind of issue.

Have you tried adding also SELECT with the UPDATE?

There is already a different SELECT policy - since more users need to be able to SELECT than UPDATE. Do you think separate policies is the issue?

In short, you need to be the commissioner to edit a league, but any authenticated user can see a league if it’s public or that user is in the invites…

BUT!! As I’m typing this, I guess removing that user’s email from the invites array means they can’t select it anymore… Maybe the invites array shouldn’t live on the league, but rather an array of league IDs should live on the profile for that user so they can change those records…

Thanks, I’ll try to rework the structure, or create a function/trigger combo that will handle these deletions on the back-end.