Repository navigation
metadata(oracle), dialect: users and roles with plain read rights, a user granted like a role - #106
Merged
Conversation
…user granted like a role The Oracle metadata reads users from ALL_USERS, which every user may read, and roles and memberships from USER_ROLE_PRIVS and ROLE_ROLE_PRIVS: the roles the user holds, also through other roles, and the memberships among them. No DBA_ view is read, so a reader without elevated rights no longer gets an empty list of principals or only its own memberships. DdlGenerator.supportsUserAsRole says whether grantRole may name a user where it names a role. PostgreSQL grants a user like any role, a user being a role that may log in; MySQL from 8.0 does too, users and roles being accounts alike. MariaDB grants roles made with CREATE ROLE only, as do the other databases. Tested in Docker on Oracle 23, PostgreSQL 12 and 16 and MySQL 5.7 to 9. Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
MariaDB refuses a user where GRANT names a role and grants a role made with CREATE ROLE, as supportsUserAsRole says; tested on MariaDB 10.6 and 11.4. Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Oracle metadata reads users from
ALL_USERS, which every user may read, and roles and memberships fromUSER_ROLE_PRIVSandROLE_ROLE_PRIVS: the roles the reading user holds, also through other roles, and the memberships among them. NoDBA_view is read, so a reader without elevated rights no longer gets an empty list of principals or only its own memberships.DdlGenerator.supportsUserAsRole()says whethergrantRolemay name a user where it names a role. PostgreSQL grants a user like any role, a user being a role that may log in; MySQL from 8.0 does too, users and roles being accounts alike. MariaDB grants roles made withCREATE ROLEonly, as do the other dialects.Tested in Docker:
supportsUserAsRolein the consistency tests