]> granicus.if.org Git - postgresql/commit
Adjust the permissions required for COMMENT ON ROLE.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 9 Mar 2011 16:28:20 +0000 (11:28 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 9 Mar 2011 16:28:34 +0000 (11:28 -0500)
commit49a08ca1e968860fe02fa3331cc0aba361d76e02
treeaa0f736da4c1590b1df64f00bd8bba430d2ec459
parentc290476cbd2e2d5f8f6c7c24ebaa5133ec37ecde
Adjust the permissions required for COMMENT ON ROLE.

Formerly, any member of a role could change the role's comment, as of
course could superusers; but holders of CREATEROLE privilege could not,
unless they were also members.  This led to the odd situation that a
CREATEROLE holder could create a role but then could not comment on it.
It also seems a bit dubious to let an unprivileged user change his own
comment, let alone those of group roles he belongs to.  So, change the
rule to be "you must be superuser to comment on a superuser role, or
hold CREATEROLE to comment on non-superuser roles".  This is the same
as the privilege check for creating/dropping roles, and thus fits much
better with the rule for other object types, namely that only the owner
of an object can comment on it.

In passing, clean up the documentation for COMMENT a little bit.

Per complaint from Owen Jacobson and subsequent discussion.
doc/src/sgml/func.sgml
doc/src/sgml/ref/comment.sgml
src/backend/catalog/aclchk.c
src/backend/catalog/objectaddress.c
src/backend/commands/user.c
src/include/utils/acl.h