postgresql/src
Robert Haas 25bb03166b Refactor permissions-checking for role grants.
Instead of having checks in AddRoleMems() and DelRoleMems(), have
the callers perform checks where it's required. In some cases it
isn't, either because the caller has already performed a check for
the same condition, or because the check couldn't possibly fail.

The "Skip permission check if nothing to do" check in each of
AddRoleMems() and DelRoleMems() is pointless. Some call sites
can't pass an empty list. Others can, but in those cases, the role
being modified is one that the current user has just created.
Therefore, they must have permission to modify it, and so no
permission check is required at all.

This patch is intended to have no user-visible consequences. It is
intended to simplify future work in this area.

Patch by me, reviewed by Mark Dilger.

Discussion: http://postgr.es/m/CA+TgmobFzTLkLwOquFrAcdsWBsOWDr-_H-jw+qBvfx-wSzMwDA@mail.gmail.com
2023-01-05 14:30:40 -05:00
..
backend Refactor permissions-checking for role grants. 2023-01-05 14:30:40 -05:00
bin During pg_dump startup, acquire table locks in batches. 2023-01-03 17:56:44 -05:00
common Update copyright for 2023 2023-01-02 15:00:37 -05:00
fe_utils Update copyright for 2023 2023-01-02 15:00:37 -05:00
include Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05:00
interfaces Update copyright for 2023 2023-01-02 15:00:37 -05:00
makefiles Update copyright for 2023 2023-01-02 15:00:37 -05:00
pl Update copyright for 2023 2023-01-02 15:00:37 -05:00
port Update copyright for 2023 2023-01-02 15:00:37 -05:00
template
test Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05:00
timezone Update copyright for 2023 2023-01-02 15:00:37 -05:00
tools Windows support in pg_import_system_collations 2023-01-03 14:21:56 +01:00
tutorial Update copyright for 2023 2023-01-02 15:00:37 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in
Makefile.shlib
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
nls-global.mk