Skip to content

Conversation

shreyeah38
Copy link

@shreyeah38 shreyeah38 commented Jun 9, 2025

Description

The following PR adds grantor information in sys.babelfish_schema_permissions catalog, 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_permissions catalog.

Part of Jira - BABEL-5690

Extension PR : amazon-aurora/babelfish_extensions#73

Signed-off-by: Shreya Rai [email protected]

@shreyeah38 shreyeah38 changed the title Added full support for sys.database_permissions view Adding Grantor Information in sys.babelfish_schema_permissions catalog Jun 10, 2025
Signed-off-by: Shreya Rai <[email protected]>
* 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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need dialect check?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes there is a dialect check inside the hook.

ReleaseSysCache(tuple);
table_close(attRelation, RowExclusiveLock);
table_close(relation, RowExclusiveLock);
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are inside FOR loop here? do we really want to exit early?

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