Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Jeff Davis <pgsql@j-davis.com>, Ted Yu <yuzhihong@gmail.com>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers@postgresql.org
Date: 2023-06-15T04:10:44Z
Lists: pgsql-hackers
On Thu, Jun 15, 2023 at 09:46:33AM +0900, Michael Paquier wrote: > The result after 0001 is applied is that a couple of > object_ownercheck() calls that existed before ff9618e are removed from > some ACL checks in the REINDEX, CLUSTER and VACUUM paths. Is that OK > for shared relations and shouldn't cluster_is_permitted_for_relation() > include that? vacuum_is_permitted_for_relation() is consistent on > this side. These object_ownercheck() calls were removed because they were redundant, as owners have all privileges by default. Privileges can be revoked from the owner, so an extra ownership check would effectively bypass the relation's ACL in that case. I looked around and didn't see any other examples of a combined ownership and ACL check like we were doing for MAINTAIN. The only thing that gives me pause is that the docs call out ownership as sufficient for some maintenance commands. With these patches, that's only true as long as no one revokes privileges from the owner. IMO we should update the docs and leave out the ownership checks since MAINTAIN is now a grantable privilege like any other. WDYT? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
Commits
-
Improve privilege documentation for maintenance commands.
- c2122aae636d 16.0 landed
-
Fix cache lookup hazards introduced by ff9618e82a.
- 4dbdb82513b6 16.0 landed
-
Move bool parameter for vacuum_rel() to option bits.
- 5b1a87994312 16.0 landed
-
Fix MAINTAIN privileges for toast tables and partitions.
- ff9618e82a46 16.0 landed
-
Add grantable MAINTAIN privilege and pg_maintain role.
- 60684dd834a2 16.0 landed