aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2023-01-05 14:30:40 -0500
committerRobert Haas <rhaas@postgresql.org>2023-01-05 14:30:40 -0500
commit25bb03166b16db1faf18c677ed88f046fb08103f (patch)
treea11571e3b1f2942be2e590c73c9b4d6d8a7ec84a /contrib/postgres_fdw/postgres_fdw.c
parent3f7836ff651ad710fef52fa87b248ecdfc6468dc (diff)
downloadpostgresql-25bb03166b16db1faf18c677ed88f046fb08103f.tar.gz
postgresql-25bb03166b16db1faf18c677ed88f046fb08103f.zip
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
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions