From: Stephen Frost <sfrost@snowman.net>
To: Artur Dudnik <adudnik@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14060: row security policy does not work for updatable views
Date: Sun, 3 Apr 2016 09:02:43 -0400
Message-ID: <20160403130243.GM10850@tamriel.snowman.net> (raw)
In-Reply-To: <CAMX2OGaqVGOZP2ijYZRnJsWScKhXt_H_pcewo9E+qt4LZrjJYQ@mail.gmail.com>
References: <20160402200106.2623.11425@wrigleys.postgresql.org>
<20160403014006.GK10850@tamriel.snowman.net>
<CAMX2OGaqVGOZP2ijYZRnJsWScKhXt_H_pcewo9E+qt4LZrjJYQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Artur,
* Artur Dudnik (adudnik@gmail.com) wrote:
> > Try creating the view as the 'test' user and you'll see that then accessing
> the table through the view will result in the RLS policy being applied.
>
> Sure, you are right.
>
> 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
Attachments:
signature.asc (application/pgp-signature, 818B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: sfrost@snowman.net, adudnik@gmail.com
Subject: Re: BUG #14060: row security policy does not work for updatable views
In-Reply-To: <20160403130243.GM10850@tamriel.snowman.net>
References: <20160402200106.2623.11425@wrigleys.postgresql.org> <20160403014006.GK10850@tamriel.snowman.net> <CAMX2OGaqVGOZP2ijYZRnJsWScKhXt_H_pcewo9E+qt4LZrjJYQ@mail.gmail.com> <20160403130243.GM10850@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox