pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Paul Lambert <paul.lambert@reynolds.com.au>
Cc: pgsql admin <pgsql-admin@postgresql.org>
Subject: Re: Schema security
Date: Thu, 13 Dec 2007 10:01:15 -0300
Message-ID: <20071213130114.GB6262@alvh.no-ip.org> (raw)
In-Reply-To: <4760C969.1060801@reynolds.com.au>
References: <4760905F.2020406@reynolds.com.au>
	<3212.1197524142@sss.pgh.pa.us>
	<4760C969.1060801@reynolds.com.au>

Paul Lambert wrote:

> Taking your example of file permissions - although it is not default 
> behavior, it is possible to recursively apply a priviledge change to a 
> directory onto files/subdirectories within it. Certainly it can be done on 
> OpenVMS and Windows that I work with primarily and I'm 99% sure it can be 
> done on *ix systems too.
>
> I.e.
> GRANT ALL ON SCHEMA <blah> TO <role> CASCADE;
> NOTICE: GRANT ALL cascades to table "billings"
> NOTICE: GRANT ALL cascades to table "customers"
> NOTICE: GRANT ALL cascades to function "calculate_daily_balance()"
> etc...

Yes, it can be done at least with GNU chmod by using chmod -R.

The problem is that it doesn't work too well for schemas -> tables,
because the set of acceptable privileges is completely different.  So
the only case that would work is GRANT ALL.  Perhaps what could work is
to be able to specify wildcards in GRANT, for example

GRANT SELECT, INSERT ON TABLE schema.* TO <role>

The problem with this idea is what happens if you create a new table in
that schema?  Is the role given access to that table?  (The other
problem is whether this new command conforms to the SQL standard, or is
it in conflict with it.)

-- 
Alvaro Herrera                 http://www.amazon.com/gp/registry/CTMLCN8V17R4
"Estoy de acuerdo contigo en que la verdad absoluta no existe...
El problema es que la mentira sí existe y tu estás mintiendo" (G. Lama)



view thread (7+ messages)  latest in thread

Message-ID: <20071213130114.GB6262@alvh.no-ip.org>
Permalink:  ../20071213130114.GB6262@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20071213130114.GB6262@alvh.no-ip.org

 · 

reply

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-admin@postgresql.org
  Cc: alvherre@alvh.no-ip.org, paul.lambert@reynolds.com.au
  Subject: Re: Schema security
  In-Reply-To: <20071213130114.GB6262@alvh.no-ip.org>
  References: <4760905F.2020406@reynolds.com.au> <3212.1197524142@sss.pgh.pa.us> <4760C969.1060801@reynolds.com.au> <20071213130114.GB6262@alvh.no-ip.org>

* 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