Обсуждение: pgsql: Allow grant-level control of role inheritance behavior.

Поиск
Список
Период
Сортировка

pgsql: Allow grant-level control of role inheritance behavior.

От
Robert Haas
Дата:
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(-)