I want to use PostgreSQL RLS capabilities to enable row level security in a database containing health sensitive data.
Privacy by design is my main concern.
Basically, I'm forced to connect to the database with a generic application user to benefit from connection pooling, but then I would like to use some kind of magic to use a user's GUID coming from an authorization token to prevent him from accessing other user's data.
Because I'm using GraphQL and don't want to hardcode this kind of behaviour in client and/or DAL code, I'm wondering if RLS in PostgreSQL may help.
Thanks for your insights.
EDIT 1: Mays be this answer may help.