Skip site navigation (1) Skip section navigation (2)

Rules and Permissions docs change (was Re: BUG #1610: rewrite rule and sequence)

From: Richard Huxton <dev(at)archonet(dot)com>
To: Olleg Samoylov <olleg(at)mipt(dot)ru>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-docs(at)postgresql(dot)org
Subject: Rules and Permissions docs change (was Re: BUG #1610: rewrite rule and sequence)
Date: 2005-04-22 08:03:17
Message-ID: 4268AFC5.8080506@archonet.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-docs
Olleg Samoylov wrote:
> Richard Huxton wrote:
> 
>> That's not a bug, it's a feature (as they say). I suppose you could
>> argue that a sequence only used by one table could inherit that
>> table's permissions by default, but I can see problems when people
>> reorder GRANT statements.

> It's not feature, it's bug. From postgresql documentation 33.4. Rules
> and Privileges:
> <quote> Relations that are used due to rules get checked against the
> privileges of the rule owner, not the user invoking the rule. This means
> that a user only needs the required privileges for the tables/views that
> he names explicitly in his queries.</quote>
> 
> This dont' true for tables with serial fields.

Hmm - perhaps the documentation needs expanding. Certainly, if your view 
references functions you need to make sure permissions are set correctly 
on those.

How about changes along the lines of:

Ch 33.4, para 2
"... Relations that are used due to rules get checked against the 
privileges of the rule owner, not the user invoking the rule. This means 
that a user only needs the required privileges for the objects[1] that 
he names explicitly in his queries."

then

"[1] This includes permissions on tables and views you reference in your 
view definition. It might also include execute permissions on any 
functions referenced, and for updates, permissions on any sequences. 
This includes sequences automatically created by use of the SERIAL type."

Perhaps we should also have a reminder to read the rules chapter in the 
serial description (ch 8.1.4)

--
   Richard Huxton
   Archonet Ltd

In response to

Responses

pgsql-docs by date

Next:From: Bruce MomjianDate: 2005-04-23 03:28:48
Subject: Improve documentation in setting FSM
Previous:From: Olleg SamoylovDate: 2005-04-22 06:33:10
Subject: Re: BUG #1610: rewrite rule and sequence

pgsql-bugs by date

Next:From: Ingolf KnopfDate: 2005-04-22 08:33:48
Subject: Re: BUG #1611: reading a date-field by "ResultSet.getTimestamp()" method analized dayligth flag
Previous:From: Ron MayerDate: 2005-04-22 07:53:30
Subject: Transactions and "create or replace function"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group