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

Improve messages for column access error in FileBasedAccessControl #25321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

takezoe
Copy link
Member

@takezoe takezoe commented Mar 15, 2025

Description

Improve messages for column access error in FileBasedAccessControl and FileBasedSystemAccessControl to make those messages consistent with other access control implementations.

Other access controls show requested columns when column-level access check fails.

public void checkCanSelectFromColumns(SystemSecurityContext context, CatalogSchemaTableName table, Set<String> columns)
{
for (RangerTrinoResource resource : RangerTrinoResource.forColumns(table.getCatalogName(), table.getSchemaTableName().getSchemaName(), table.getSchemaTableName().getTableName(), columns)) {
if (!hasPermission(resource, context, SELECT, "SelectFromColumns")) {
denySelectColumns(table.getSchemaTableName().getTableName(), columns);
}
}
}

@Override
public void checkCanSelectFromColumns(SystemSecurityContext context, CatalogSchemaTableName table, Set<String> columns)
{
checkTableAndColumnsOperation(context, "SelectFromColumns", table, columns, AccessDeniedException::denySelectColumns);
}

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Mar 15, 2025
@takezoe takezoe force-pushed the improve-filebased-access-control-error-message branch 2 times, most recently from b0c6bba to 95d5af1 Compare March 15, 2025 03:27
@github-actions github-actions bot added the hive Hive connector label Mar 15, 2025
@takezoe takezoe force-pushed the improve-filebased-access-control-error-message branch from 95d5af1 to 99856ff Compare March 15, 2025 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector
Development

Successfully merging this pull request may close these issues.

1 participant