-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add support for GRANT/DENY/REVOKE on branches #25152
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
Conversation
8322da8 to
03d2d0d
Compare
03d2d0d to
8eee28a
Compare
96303ed to
611d6cd
Compare
611d6cd to
4c6df1f
Compare
0b7aa49 to
91bc773
Compare
|
awesome PR! |
core/trino-grammar/src/main/antlr4/io/trino/grammar/sql/SqlBase.g4
Outdated
Show resolved
Hide resolved
91bc773 to
a02b041
Compare
a02b041 to
8b641c2
Compare
8b641c2 to
e735a89
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.
Skimmed through the two initial commits.
core/trino-main/src/main/java/io/trino/execution/GrantTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/security/AccessControlManager.java
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SqlStandardAccessControl.java
Show resolved
Hide resolved
e735a89 to
5c15495
Compare
c3b9148 to
6c8b7f7
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.
LGTM % comments. Most importantly, we should decide upon handling the identifier.
| metadata.denyTablePrivileges(session, tableName, privileges, createPrincipal(statement.getGrantee())); | ||
| } | ||
| else { | ||
| String branchName = branch.get().getValue(); |
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.
We don't have proper Identifier semantics in Trino, but it would be closer to correct if we used getCanonicalValue() instead of getValue().
However, I just noticed that we also rely on getValue() when creating the branch...
On the other hand, when creating a QualifiedName, we rely on this method, which lowercases identifiers.
I think that for branches, we should also lowercase the name to keep it locally consistent.
Same applies to GrantTask and RevokeTask.
@martint what do you think?
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.
I will send a follow-up PR if Martin request changes.
core/trino-main/src/main/java/io/trino/metadata/SystemSecurityMetadata.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/java/io/trino/sql/parser/AstBuilder.java
Outdated
Show resolved
Hide resolved
core/trino-spi/src/main/java/io/trino/spi/security/SystemAccessControl.java
Outdated
Show resolved
Hide resolved
6c8b7f7 to
ec04151
Compare
ec04151 to
6c3100c
Compare
Description
Syntax proposal: https://docs.google.com/document/d/1jEF4IkWu-2Gzk5ii2Nb0exuEnAUeo98UbiM3i0xtgWQ/edit?usp=sharing
This adds a new privilege
CREATE BRANCHfor access control of branches.Relates to #12844
Release notes