News for hackers. Stuff that matters.
Re:Row Level Security with PostgreSQL 9.5 by davidw on Wednesday April 20, 2016 @02:00PM (#11536355)
> But, you do have to enable it for each table plus you need to commit to using database roles as a main security mechanism. That last part is the barrier but also the reason to use such a feature.

That's kind of a sticking point for web apps. Wonder if there's a way around that.

Re:Row Level Security with PostgreSQL 9.5 by elchief on Wednesday April 20, 2016 @02:15PM (#11536485)
It's pretty easy to set the user's role after connecting:

https://stackoverflow.com/questions/2998597/switch-role-afte...

Re:Row Level Security with PostgreSQL 9.5 by rch on Wednesday April 20, 2016 @02:10PM (#11536442)
It can be really nice for enterprise web apps. One might have thousands of users organized into a handful of departments with different authorizations, some of which have their own DBAs and developers. Solid testing on the application side is important, of course.
Re:Row Level Security with PostgreSQL 9.5 by rst on Wednesday April 20, 2016 @02:25PM (#11536584)
If the database roles correspond to departments, and authorizations at a department level, this sort of thing can be quite useful. (e.g., in a hospital, designating certain rows as visible only to the psychiatry department, in a way that developers within other departments can't screw it up.)

But establishing a DB role for every distinct person within a department gets awkward very fast, particularly if permissioning requirements have a bit of business logic associated with them (e.g., "this row can be updated by the user designated in the row itself as "owner", and is visible to both them and anyone designated in this other table over here as their assistant...") So, you'll often still need additional permissioning logic within the webapp regardless.

Re:Row Level Security with PostgreSQL 9.5 by rch on Wednesday April 20, 2016 @06:25PM (#11538192)
Yes, exactly. Roles would generally be by department, or in an application/department matrix.

Your hospital example is spot on, and in finance a department might be a trading group.