Debug RLS

I have RLS turned on for a table I'm not able to insert a row because it's violating RLS for that table.

From what I can tell everything should be working as expected.

The policy check is (auth.uid() = creator_profile_id) and this is the code to create insert a row.

    const { data, error: listError } = await supabase
      .from("lists")
      .insert([
        {
          creator_profile_id: user.id,
          name: listName,
          google_place_id: selectedPlace.placeId,
          google_place_name: selectedPlace.description,
          google_place_types: JSON.stringify(selectedPlace.types),
          photo_url: await getPhoto(selectedPlace?.description),
        },
      ])
      .select("*");


What's the best way to debug this and figure out why it's saying that new row violates row-level security policy for table \"lists\"
Screenshot_2022-11-04_at_3.48.04_PM.png
Was this page helpful?