3 ms·
Yep thanks for fleshing it out. After configuring it as the parent post says, you set the environment variable like so: SET myapp.manager = '123e4567-e89b-12d
by andrewstuart 2y ago
Yep thanks for fleshing it out.
After configuring it as the parent post says, you set the environment variable like so:
SET myapp.manager = '123e4567-e89b-12d3-a456-426614174000';
Then you can just query the database and it will only return records where manager = '123e4567-e89b-12d3-a456-426614174000'
It's something like that anyway - you have to do lots of reading the docs and fiddling to make sure all the bits and pieces are set up right for it to work - which is why these folks are creating a SAAS to do all the thinking for you.
The real benefit of RLS is developers don't have to put "WHERE company_id=whatevere" on all queries, along with the risk that leaving it out or writing it wrong will reveal one client's data in another clients user interface.