Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: address tech debt and edge cases in ALTER DEFAULT PRIVILEGES and REASSIGN OWNED BY #132929

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Oct 18, 2024

sql: allow admins to ALTER DEFAULT PRIVILEGES for any role

Release note (bug fix): Users with the admin role can now run ALTER DEFAULT PRIVILEGES FOR target_role ... on any target_role. Previously,
this could result in a privilege error, which is incorrect as admins are
allowed to perform any operation.


sql: address TODO for REASSIGN OWNED for public schema

Release note (bug fix): REASSIGN OWNED BY will now transfer ownership of
the public schema. Previously, it would always skip over the public
schema even if it was owned by the target role.


sql: fix ownership checks in REASSIGN OWNED BY

It was not correct to use the isOwner helper function here, since that
implicitly returns true for any admin role.

For REASSIGN OWNED BY, we only should reassign ownership if the object
is explicitly owned by the given role.

Release note: None


Epic: None

Release note (bug fix): Users with the admin role can now run `ALTER
DEFAULT PRIVILEGES FOR target_role ...` on any target_role. Previously,
this could result in a privilege error, which is incorrect as admins are
allowed to perform any operation.
Release note (bug fix): REASSIGN OWNED BY will now transfer ownership of
the public schema. Previously, it would always skip over the public
schema even if it was owned by the target role.
It was not correct to use the isOwner helper function here, since that
implicitly returns true for any admin role.

For REASSIGN OWNED BY, we only should reassign ownership if the object
is explicitly owned by the given role.

Release note: None
@rafiss rafiss requested a review from spilchen October 18, 2024 16:41
@rafiss rafiss requested a review from a team as a code owner October 18, 2024 16:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants