From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dado Feigenblatt <dado@wildbrain.com>
Cc: josh@agliodbs.com
Cc: pgsql-sql@postgresql.org
Subject: Re: creating variable views
Date: Sat, 07 Jul 2001 15:03:44 -0400
Message-ID: <28562.994532624@sss.pgh.pa.us> (raw)
In-Reply-To: <3B463AAA.D891C6F@wildbrain.com>
References: <web-79542@davinci.ethosmedia.com>
<3B463AAA.D891C6F@wildbrain.com>
Dado Feigenblatt <dado@wildbrain.com> writes:
> One thing that still isn't clear for me is how to implement access level
> control on a per row basis.
The SQL GRANT/REVOKE stuff doesn't deal with anything finer-grain than
tables. The best way I know to cope with a need for row-level read
access control is to create a view that shows only the records you want
someone to be able to see, then grant them access to the view not the
original table.
For write access control, you have a choice of putting the controls into
the ON INSERT etc rules you make for the view, or attaching triggers to
the underlying table and checking access permissions in the triggers.
The trigger method is probably easier to deal with, but bear in mind
that such triggers will fire for everyone, including people who've been
granted direct access to the underlying table. This might or might not
be just what you want...
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, dado@wildbrain.com, josh@agliodbs.com
Subject: Re: creating variable views
In-Reply-To: <28562.994532624@sss.pgh.pa.us>
* 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