question on row level security

Поиск
Список
Период
Сортировка
От Tim Dudgeon
Тема question on row level security
Дата
Msg-id 56840D1A.8030203@gmail.com
обсуждение исходный текст
Ответы Re: question on row level security  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: question on row level security  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: question on row level security  (Joe Conway <mail@joeconway.com>)
Список pgsql-sql
The new row level security feature in 9.5 looks great.
I guess its designed around the need to restrict access based on the 
current database user (current_user) where this maps to a database user.
But most applications now access the database using an application user 
and manages data for the applications multiple users (probably with each 
user being a row in a USERS table somewhere).
Is there any way to "inject" the application user so that this can be 
used in a RLS check?
e.g. conceptually:

set app_user 'john';
select * from foo;

where the select * is restricted by a RLS check that includes 'john' as 
the app_user.
Of course custom SQL could be generated for this, but it would be safer 
if it could be handled using RLS.

Any ways to do this?

Tim




В списке pgsql-sql по дате отправления:

Предыдущее
От: Steve Midgley
Дата:
Сообщение: Re: Stucks in the middle
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: question on row level security