-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implement Role Management in Presto #494
Comments
CREATE ROLECreates role in Syntax:
SPI Modifications:
|
GRANT ROLEGrants role to the specified user in Due to the SQL standard a role can be granted either to a user or to a another role. SQL standard also says that DBMS engine must ensure user/role name uniqueness, what is not possible in terms of Presto. As a workaround we introduce additional keywords Syntax:
Examples
SPI Modifications:
|
REVOKE ROLERevokes role from the specified user in Syntax:
SPI Modifications:
Follow-up
|
DROP ROLEDrops role in Syntax:
SPI Modifications:
|
VIEW: ROLES
Lists all the roles available in Output Columns:
SPI Modifications:
|
SHOW ROLE GRANT [follow-up]Show roles granted to user in Syntax:
|
SHOW ROLES [follow-up]Shows all available roles in Syntax:
|
SET ROLESet the current role name for the current SQL-session context in Syntax:
SPI Modifications:
Implementation design
|
VIEW: APPLICABLE_ROLES
Recursively Identifies the applicable roles for the current user in Output Columns:
|
VIEW: ENABLED_ROLES
Recursively identify the enabled roles for the current SQL-session for Output Columns:
|
SHOW CURRENT ROLES [follow-up]Shows all available roles in Syntax:
|
PERMISSIONSAs Presto is only data providers aggregator, no special permissions for invoking any of the above commands must be checked explicitly by Presto. All the commands must be silently passed to the underlying connector, and the connector itself must decide whether to allow execution or not. |
Very thorough! I have some comments, both to pare down what we have to do to make it a smaller MVP, and additional suggestions.
|
Let's assume that you are logged in as user As described in I would like to introduce
Ditto about SPI modifications
Do you think it is better to expose separate method in SPI?
+1
+1
Yes, we can implement it later. It doesn't involve any breaking changes in the SPI
+1 |
I was suggesting now allowing recursive ROLE, but it's the same amount of work so we might as well have it. Looks good! |
@cawallin @martint @maciejgrzybek Please review
The text was updated successfully, but these errors were encountered: