Not clear how to switch role without permitting switch back

From: Guyren Howe <guyren(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Not clear how to switch role without permitting switch back
Date: 2017-01-10 07:05:47
Message-ID: 1398A0CB-EC4F-4C51-A731-0C6545A9AE00@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

For my Love Your Database Project:

https://medium.com/@gisborne/love-your-database-lydb-23c69f480a1d#.8g1ezwx6r <https://medium.com/@gisborne/love-your-database-lydb-23c69f480a1d#.8g1ezwx6r>

I’m trying to see how a typical web developer might use Postgres’ roles and row-level security to implement their authorization.

What I’m struggling with is that connection pooling seems to make straightforward use of the roles to enforce access impossible.

If I’m using a connection pool, then I’m not re-connecting to Postgres with the user for the current transaction. But then my only option is to use SET ROLE. But that is not much security at all, because the current user can just do SET ROLE back to the (presumably privileged) default, or to any other user’s role.

What am I missing here?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-01-10 08:56:25 Re: Not clear how to switch role without permitting switch back
Previous Message David G. Johnston 2017-01-10 03:20:25 Re: Slow index scan - Pgsql 9.2