Fix GRANTED BY support in REVOKE ROLE statements
Daniel Gustafsson <dgustafsson@postgresql.org>
Fix GRANTED BY support in REVOKE ROLE statements Commit 6aaaa76bb added support for the GRANTED BY clause in GRANT and REVOKE statements, but missed adding support for checking the role in the REVOKE ROLE case. Fix by checking that the parsed role matches the CURRENT_ROLE/CURRENT_USER requirement, and also add some tests for it. Backpatch to v14 where GRANTED BY support was introduced. Discussion: https://postgr.es/m/B7F6699A-A984-4943-B9BF-CEB84C003527@yesql.se Backpatch-through: 14
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/user.c | modified | +11 −0 |
| src/backend/parser/gram.y | modified | +2 −0 |
| src/test/regress/expected/privileges.out | modified | +9 −0 |
| src/test/regress/sql/privileges.sql | modified | +8 −0 |
Discussion
- Allow CURRENT_ROLE in GRANTED BY 19 messages · 2020-06-24 → 2021-11-26