pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow grant-level control of role inheritance behavior.
Date: Thu, 25 Aug 2022 14:18:05 +0000
Message-ID: <E1oRDgK-0019cI-10@gemulon.postgresql.org> (raw)

Allow grant-level control of role inheritance behavior.

The GRANT statement can now specify WITH INHERIT TRUE or WITH
INHERIT FALSE to control whether the member inherits the granted
role's permissions. For symmetry, you can now likewise write
WITH ADMIN TRUE or WITH ADMIN FALSE to turn ADMIN OPTION on or off.

If a GRANT does not specify WITH INHERIT, the behavior based on
whether the member role is marked INHERIT or NOINHERIT. This means
that if all roles are marked INHERIT or NOINHERIT before any role
grants are performed, the behavior is identical to what we had before;
otherwise, it's different, because ALTER ROLE [NO]INHERIT now only
changes the default behavior of future grants, and has no effect on
existing ones.

Patch by me. Reviewed and testing by Nathan Bossart and Tushar Ahuja,
with design-level comments from various others.

Discussion: http://postgr.es/m/CA+Tgmoa5Sf4PiWrfxA=sGzDKg0Ojo3dADw=wAHOhR9dggV=RmQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e3ce2de09d814f8770b2e3b3c152b7671bcdb83f

Modified Files
--------------
doc/src/sgml/catalogs.sgml               |  10 ++
doc/src/sgml/ref/create_role.sgml        |  29 ++--
doc/src/sgml/ref/grant.sgml              |  26 ++-
doc/src/sgml/ref/revoke.sgml             |   9 +-
src/backend/commands/user.c              | 262 +++++++++++++++++++++++++------
src/backend/parser/gram.y                |  49 ++++--
src/backend/tcop/utility.c               |   2 +-
src/backend/utils/adt/acl.c              |  47 ++----
src/bin/pg_dump/pg_dumpall.c             |  32 +++-
src/include/catalog/catversion.h         |   2 +-
src/include/catalog/pg_auth_members.h    |   1 +
src/include/commands/user.h              |   2 +-
src/include/nodes/parsenodes.h           |   2 +-
src/test/regress/expected/privileges.out |  14 +-
src/test/regress/sql/privileges.sql      |  13 +-
15 files changed, 385 insertions(+), 115 deletions(-)



Message-ID: <E1oRDgK-0019cI-10@gemulon.postgresql.org>
Permalink:  ../E1oRDgK-0019cI-10@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oRDgK-0019cI-10@gemulon.postgresql.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-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Allow grant-level control of role inheritance behavior.
  In-Reply-To: <E1oRDgK-0019cI-10@gemulon.postgresql.org>
  References: <E1oRDgK-0019cI-10@gemulon.postgresql.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