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

Support role management #7898

Closed
wants to merge 51 commits into from

Conversation

arhimondr
Copy link
Member

@arhimondr arhimondr commented Apr 25, 2017

This PR enables roles management through Presto.

It covers all the syntax explained here: Teradata#494

Although the PR is enormous - it can be reviewed and merged partially.

  1. CREATE/DROP/LIST ROLES - commits through Introduce CREATE ROLE and DROP ROLE statements to Implement Create/Drop/List roles in Hive connector

  2. GRANT/REVOKE ROLES - commits through Introduce GRANT/REVOKE roles statements to Prepare metastore interface to accept ROLE for GRANT/REVOKE

  3. SET ROLE - commits through Introduce SET ROLE statement to Accept ROLE in GRANT/REVOKE Privileges statements

  4. SHOW ROLES, SHOW CURRENT ROLES, SHOW ROLE GRANTS shortcuts - commits through Add SHOW ROLES to the parser to Access control for SHOW ROLE GRANTS and SHOW CURRENT ROLES

  5. Consider role set with SET ROLE when checking permissions - commits through Remove redundant checkDatabasePermission methods to More product tests for SET ROLE

  6. Roles management documentation - Document role management

@arhimondr arhimondr force-pushed the support_role_management branch 3 times, most recently from 5744956 to 0ce6e29 Compare April 25, 2017 21:13
@arhimondr arhimondr force-pushed the support_role_management branch from 0ce6e29 to 8f35e71 Compare April 27, 2017 18:47
@arhimondr arhimondr force-pushed the support_role_management branch from 8f35e71 to 08b367a Compare May 16, 2017 15:21
@arhimondr arhimondr force-pushed the support_role_management branch 2 times, most recently from 24eaa60 to 31de171 Compare May 31, 2017 20:13
@arhimondr arhimondr force-pushed the support_role_management branch from 31de171 to bf1739f Compare June 12, 2017 15:08
@amrutagokhale amrutagokhale force-pushed the support_role_management branch from bf1739f to 73a38b1 Compare June 27, 2017 20:01
@arhimondr arhimondr force-pushed the support_role_management branch from 73a38b1 to 77c464d Compare July 28, 2017 21:36
@arhimondr arhimondr force-pushed the support_role_management branch from 77c464d to b9dca17 Compare August 25, 2017 15:55
cawallin and others added 26 commits August 28, 2017 13:02
Instead of select * from information_schema.roles, SHOW CURRENT ROLES
rewrites to select * from information_schema.enabled_roles.

All users can see what roles they're currently using, so no need
for access control checks.
Currently the only database permission we support is OWNERSHIP.
Instead of creating that permission, and checking if it is granted
it is more readable to just call `isDatabaseOwner` directly.
Admin user has all the available permissions for all the entities
implicitly. So it may be considered as a database and table "owner"
for all tables and databases. Also it has all the SELECT, INSERT, DELETE
permissions implicitly.
hasGrantOptionForPrivilege cannot be used in security checks for createView
because it doesn't consider the session role.
Verify that role set with `SET ROLE` is considering during the access check.
@arhimondr arhimondr force-pushed the support_role_management branch from b9dca17 to 8f09296 Compare August 28, 2017 17:36
@findepi
Copy link
Contributor

findepi commented Nov 17, 2017

Superseded by #9366

@findepi findepi closed this Nov 17, 2017
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.

5 participants