[rest] Align view permission handling with table in RESTCatalog.#7641
Open
shyjsarah wants to merge 2 commits intoapache:masterfrom
Open
[rest] Align view permission handling with table in RESTCatalog.#7641shyjsarah wants to merge 2 commits intoapache:masterfrom
shyjsarah wants to merge 2 commits intoapache:masterfrom
Conversation
…r view operations in RESTCatalog Align view permission handling with table in RESTCatalog by catching ForbiddenException and throwing ViewNoPermissionException for all view operations (get/create/drop/rename/alter/list). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a38da0c to
340c4df
Compare
The renameViewHandle has a separate code path from viewHandle and was missing the noPermissionViews check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JingsongLi
reviewed
Apr 14, 2026
| /** Exception for trying to operate on the view that doesn't have permission. */ | ||
| class ViewNoPermissionException extends RuntimeException { | ||
|
|
||
| private static final String MSG = "View %s has no permission. Cause by %s."; |
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.
Purpose
Align view permission handling with table in RESTCatalog.
Currently, table operations in
RESTCatalogcatchForbiddenExceptionand throwTableNoPermissionException, but view operations(
getView,createView,dropView,renameView,alterView,listViews, etc.) do not handleForbiddenExceptionat all.This PR adds:
ViewNoPermissionExceptioninCatalog.java, mirroringTableNoPermissionExceptionForbiddenExceptionhandling for all view operations inRESTCatalogDatabaseNoPermissionExceptionhandling for list view operations (consistent with list table behavior)Tests
testApiWhenViewNoPermissioninRESTCatalogTestto verify thatgetView,dropView,renameView, andalterViewthrowViewNoPermissionExceptionwhen permission is revokedRESTCatalogServerto supportnoPermissionViewsand return 403 for forbidden view operations