dmytro.eth
04/05/2022, 9:15 AMcountries
where each country
has a people
array of uuid. Every county
can have multiple cities
where each city
has one county_id
. I want to giver CRUD access to cities
for the people
.
How can I set it up using the RLS?
UPD: Added a SQL diagram in the thread.dmytro.eth
04/05/2022, 9:49 AMdmytro.eth
04/05/2022, 9:56 AMcreate policy "People can all on own cities"
on cities for all
using (auth.uid() = any (
select people
from counties
where (country_id = id)
))
But it gives operator does not exist: uuid = uuid[]
tourdownunder
04/05/2022, 10:01 AMsql
select unnest(people)
from counties
dmytro.eth
04/05/2022, 10:38 AMtourdownunder
04/05/2022, 10:40 AM