postgresql/src/backend
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
..
access Check that xmax didn't commit in freeze check. 2023-01-03 21:48:27 -08:00
backup Update copyright for 2023 2023-01-02 15:00:37 -05:00
bootstrap Update copyright for 2023 2023-01-02 15:00:37 -05:00
catalog Update copyright for 2023 2023-01-02 15:00:37 -05:00
commands Refactor permissions-checking for role grants. 2023-01-05 14:30:40 -05:00
executor Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05:00
foreign Update copyright for 2023 2023-01-02 15:00:37 -05:00
jit Fix typos in comments, code and documentation 2023-01-03 16:26:14 +09:00
lib Update copyright for 2023 2023-01-02 15:00:37 -05:00
libpq Update copyright for 2023 2023-01-02 15:00:37 -05:00
main Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodes Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05:00
optimizer Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05:00
parser Update copyright for 2023 2023-01-02 15:00:37 -05:00
partitioning Update copyright for 2023 2023-01-02 15:00:37 -05:00
po 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
postmaster Update copyright for 2023 2023-01-02 15:00:37 -05:00
regex Update copyright for 2023 2023-01-02 15:00:37 -05:00
replication Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05:00
rewrite Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05:00
snowball Update copyright for 2023 2023-01-02 15:00:37 -05:00
statistics Update copyright for 2023 2023-01-02 15:00:37 -05:00
storage Update copyright for 2023 2023-01-02 15:00:37 -05:00
tcop Update copyright for 2023 2023-01-02 15:00:37 -05:00
tsearch Update copyright for 2023 2023-01-02 15:00:37 -05:00
utils Fix some compiler warnings in aset.c and generation.c 2023-01-05 12:56:17 +13:00
.gitignore
Makefile Update copyright for 2023 2023-01-02 15:00:37 -05:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00