From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@commandprompt.com>
To: Euler Taveira de Oliveira <euler@timbira.com>
To: Owen Jacobson <owen.jacobson@grimoire.ca>
To: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: CREATEROLE does not permit commenting on newly-created roles
Date: Tue, 08 Mar 2011 23:48:28 -0500
Message-ID: <9098.1299646108@sss.pgh.pa.us> (raw)
In-Reply-To: <11529.1299600744@sss.pgh.pa.us>
References: <AANLkTikUMg1VZZ8QoE+kniY8p31k7bmJZ=JB+ABeXLY6@mail.gmail.com>
<4D75B945.7040304@timbira.com>
<1299599930-sup-5129@alvh.no-ip.org>
<11529.1299600744@sss.pgh.pa.us>
I wrote:
> I thought there was nothing particularly unreasonable about Owen's
> suggestion: let users with the CREATEROLE attribute comment on any role.
> I don't think COMMENT added to CREATE ROLE would be a very nice fix
> (aside from being ugly, what if you want to change the comment later?).
> It strikes me actually that letting members of the role comment on it
> is not an amazingly good idea. They are not owners of the role in any
> meaningful sense --- for instance, they can't drop it. It'd be more
> reasonable and consistent to say that only superusers and holders of
> CREATEROLE can do COMMENT ON ROLE.
In particular, I suggest the attached patch (code-complete, but sans
documentation changes). The changes here bring COMMENT ON ROLE into
line with the permission requirements for other operations on roles
that require ownership-like permissions. This patch modifies
check_object_ownership, which means it affects three call sites at
present:
COMMENT ON ROLE
ALTER EXTENSION ADD/DROP (but the target object cannot be a role)
SECURITY LABEL IS (also couldn't be a role, at the moment)
The SECURITY LABEL case, even though it's presently unimplemented,
seems to me to be a darn good argument for redefining the notion
of "role ownership" like this. Who would want a mere member of some
group role to be able to set that role's security label?
Comments, objections?
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 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: tgl@sss.pgh.pa.us, alvherre@commandprompt.com, euler@timbira.com, owen.jacobson@grimoire.ca
Subject: Re: CREATEROLE does not permit commenting on newly-created roles
In-Reply-To: <9098.1299646108@sss.pgh.pa.us>
References: <AANLkTikUMg1VZZ8QoE+kniY8p31k7bmJZ=JB+ABeXLY6@mail.gmail.com> <4D75B945.7040304@timbira.com> <1299599930-sup-5129@alvh.no-ip.org> <11529.1299600744@sss.pgh.pa.us> <9098.1299646108@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