Hacker News new | ask | show | jobs
by AlterEgo20 4281 days ago
There are `security_barrier` VIEWs. They give a "way of restricting a given connection/user to only rows with the right foreign key in a table". Still you have to create them all (not a simple task for complex DB scheme).
1 comments

That'd make in a very simple case (an app with a user_profile table) one view per user? This doesn't sound particularly appealing...
"one view per user" - you can have a single VIEW, that filters rows based on user name ("owner_user_name" column in the base table). Or use some kind of mapping table for "user_name" <-> "table PK id". It gets more complicated with inherited user roles, but still manageable.