Re: RLS Design

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Adam Brightwell <adam(dot)brightwell(at)crunchydatasolutions(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Yeb Havinga <yeb(dot)havinga(at)portavita(dot)nl>
Subject: Re: RLS Design
Date: 2014-07-09 06:13:49
Message-ID: 20140709061349.GI16422@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert,

* Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
> If you're going to have predicates be table-level and access grants be
> table-level, then what's the value in having policies? You could just
> do:
>
> ALTER TABLE table_name GRANT ROW ACCESS TO role_name USING quals;

Yes, this would be possible (and is nearly identical to the original
patch, except that this includes per-role considerations), however, my
thinking is that it'd be simpler to work with policy names rather than
sets of quals, to use when mapping to roles, and they would potentially
be useful later for other things (eg: for setting up which policies
should be applied when, or which should be OR' or AND"d with other
policies, or having groups of policies, etc).

> As I see it, the only value in having policies as separate objects is
> that you can then, by granting access to the policy, give a particular
> user a bundle of rights rather than having to grant each right
> individually. But with this design, you've got to create the policy,
> then add the quals to it for each table, and then you still have to
> give access individually for every <row, table> combination, so what
> value is the policy object itself providing?

To clarify this part- the idea is that you would simply declare a policy
name to be a set of quals for a particular table, so you declare them
and then map a policy to roles for which it should be used. In this
arrangement, you don't declare the policy explicitly before setting the
quals, those are done at the same time.

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-07-09 06:25:09 Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Previous Message Michael Paquier 2014-07-09 06:10:37 Re: Doing better at HINTing an appropriate column within errorMissingColumn()