Re: BUG #14060: row security policy does not work for updatable views

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: BUG #14060: row security policy does not work for updatable views
Дата
Msg-id 20160403130243.GM10850@tamriel.snowman.net
обсуждение исходный текст
Ответ на BUG #14060: row security policy does not work for updatable views  (adudnik@gmail.com)
Список pgsql-bugs
Artur,

* Artur Dudnik (adudnik@gmail.com) wrote:
> > Try creating the view as the 'test' user and you'll see that then acces=
sing
> the table through the view will result in the RLS policy being applied.
>=20
> Sure, you are right.
>=20
> Excuse me for stupid question, but may be you will describe how I can
> create view for table with restricted access to rows per roles?

You can create the view as a role with a restricted set of access, as
described.

Alternatively, you can create a view owned by a role who has
unrestricted access to the table (such as the table owner) and then
implement the per-row restrictions there using WHERE and making the view
a security barrier view.

As with the regular GRANT system, it isn't possible to use the logged-in
role to perform access permission checks on a table which is being
queried through a view.

We may add support for defining policies on views in the future, but
that won't be until at least 9.7.

Thanks!

Stephen

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: BUG #14060: row security policy does not work for updatable views
Следующее
От: Noah Misch
Дата:
Сообщение: Re: BUG #14050: "could not reserve shared memory region" in postgresql log