Skip to content

Allow only Table level drop permissions to drop Generic Table#4779

Merged
flyrain merged 3 commits into
apache:mainfrom
ayushtkn:4778
Jun 17, 2026
Merged

Allow only Table level drop permissions to drop Generic Table#4779
flyrain merged 3 commits into
apache:mainfrom
ayushtkn:4778

Conversation

@ayushtkn

@ayushtkn ayushtkn commented Jun 15, 2026

Copy link
Copy Markdown
Member

Fixes: #4778

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Copilot AI review requested due to automatic review settings June 15, 2026 17:21
@github-project-automation github-project-automation Bot moved this to PRs In Progress in Basic Kanban Board Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates dropGenericTable authorization to resolve the table entity (enabling table-level grants to apply) and adds a dedicated authz test to validate behavior when privileges are granted at the table level.

Changes:

  • Switch dropGenericTable authorization from namespace-based to table-entity-based checks.
  • Add a table-level grant test case for dropGenericTable, including grant/revoke plumbing for table privileges.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandler.java Updates drop authorization to use a table-like authorizer tied to the table entity/subtype.
runtime/service/src/test/java/org/apache/polaris/service/catalog/generic/PolarisGenericTableCatalogHandlerAuthzTest.java Adds a new test factory validating drop behavior with table-level privilege grants and supporting helper builder.

Comment on lines 132 to 137
public boolean dropGenericTable(TableIdentifier identifier) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.DROP_TABLE_WITHOUT_PURGE;
authorizeCreateTableLikeUnderNamespaceOperationOrThrow(op, identifier);
authorizeBasicTableLikeOperationOrThrow(op, PolarisEntitySubType.GENERIC_TABLE, identifier);

return this.genericTableCatalog.dropGenericTable(identifier);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

for drop the table should exist only, if it doesn't exist, that seems problem only it is same behaviour as in IcebergCatalog

dimas-b
dimas-b previously approved these changes Jun 16, 2026

@dimas-b dimas-b left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch, @ayushtkn !

@gh-yzou : WDYT?

@ayushtkn

Copy link
Copy Markdown
Member Author

Thanx @dimas-b I had to rebase the PR due to merge conflict by a recent commit, nothing changes it was conflict in the import in the test class

dimas-b
dimas-b previously approved these changes Jun 16, 2026

@flyrain flyrain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM overall, thanks for the fix, @ayushtkn ! Can we add a CHANGELOG.md entry since this is a user-visible authz behavior change (table-scoped TABLE_DROP now suffices).

@ayushtkn

Copy link
Copy Markdown
Member Author

Thanx @flyrain for the review. I have added an entry in the change log

@flyrain

flyrain commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

thanks @ayushtkn , there is a merge conflict after the new commit.

@flyrain flyrain merged commit 1023530 into apache:main Jun 17, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to merge to Done in Basic Kanban Board Jun 17, 2026
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.

Allow only Table level drop permissions to drop Generic Table

6 participants