-
Notifications
You must be signed in to change notification settings - Fork 457
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: Ensure priv role refs are always valid #18783
sql: Ensure priv role refs are always valid #18783
Conversation
This commit adds privileges to the following objects: - tables - views - materialized views - sources - types - secrets - connections - secrets - clusters - databases - schemas This commit updates the on-disk stash representation and the catalog tables/views that present this information to users. Currently, privileges cannot be modified, and they are not looked at when executing statements. These features will be implemented in a future commit. Part of MaterializeInc#11579
20aae1e
to
776a586
Compare
This commit prevents dropping a role, if that role is a grantee or grantor for some object privilege. This helps ensure that the grantee and grantor references in the catalog always remain valid. Part of MaterializeInc#11579
776a586
to
ddf733a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for this?
We already have a bunch of tests that ensure that roles can't be dropped while they are the owner of an object, for example: materialize/test/sqllogictest/object_ownership.slt Lines 942 to 943 in d6e4716
GRANT , to create a privilege where the grantee or the grantor isn't the owner. So any test we write for this will be identical to the existing tests.
However, I think it's good to merge this before the I'll update the existing tests to include the error details. Then when implementing |
…p-role-privilege-check # Conflicts: # src/adapter/src/catalog.rs # src/adapter/src/catalog/storage.rs
I just updated the tests so that it includes the error messages with the privileges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests
This commit prevents dropping a role, if that role is a grantee or
grantor for some object privilege. This helps ensure that the grantee
and grantor references in the catalog always remain valid.
Part of #11579
Motivation
This PR adds a known-desirable feature.
Tips for reviewer
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way) and therefore is tagged with aT-proto
label.