Adding Grantor Information in sys.babelfish_schema_permissions catalog#132
Open
shreyeah38 wants to merge 6 commits intoamazon-aurora:bbf-database-permission-viewfrom
Open
Adding Grantor Information in sys.babelfish_schema_permissions catalog#132shreyeah38 wants to merge 6 commits intoamazon-aurora:bbf-database-permission-viewfrom
shreyeah38 wants to merge 6 commits intoamazon-aurora:bbf-database-permission-viewfrom
Conversation
Signed-off-by: Shreya Rai <shreyaxr@amazon.com>
…atabase_permissions
…atabase_permissions
…postgresql_modified_for_babelfish into database_permissions
Signed-off-by: Shreya Rai <shreyaxr@amazon.com>
Signed-off-by: Shreya Rai <shreyaxr@amazon.com>
Deepesh125
requested changes
Jun 24, 2025
| * If the hook returns false, indicates that object-level and schema-level grants both are present and schema-level grant is revoked. | ||
| * In such case we remove schema-level entry from the bbf_schema_permissions catalog but skip the execution of revoke as object-level grants exist. | ||
| */ | ||
| if (update_bbf_schema_permissions_catalog_hook && !(*update_bbf_schema_permissions_catalog_hook) (this_privileges, istmt->is_grant, istmt->grantees, |
Author
There was a problem hiding this comment.
Yes there is a dialect check inside the hook.
| ReleaseSysCache(tuple); | ||
| table_close(attRelation, RowExclusiveLock); | ||
| table_close(relation, RowExclusiveLock); | ||
| return; |
There was a problem hiding this comment.
we are inside FOR loop here? do we really want to exit early?
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.
Description
The following PR adds grantor information in
sys.babelfish_schema_permissionscatalog, addressing a current limitation in Babelfish.The functionality is achieved by hook implementation and reversing the flow of GRANT / REVOKE statement in Babelfish. This enhancement enables users to view grantor of various permissions.
Another functionality added is the storage of database-level CONNECT permission granted to users. This PR also provides a distinction between the storage of normal permissions and permissions with grant option in
sys.babelfish_schema_permissionscatalog.Part of Jira - BABEL-5690
Extension PR : amazon-aurora/babelfish_extensions#73
Signed-off-by: Shreya Rai shreyaxr@amazon.com