hdygxsj commented on code in PR #9255:
URL: https://github.com/apache/gravitino/pull/9255#discussion_r2566901124
##########
server-common/src/main/java/org/apache/gravitino/server/authorization/MetadataAuthzHelper.java:
##########
@@ -88,6 +89,46 @@ public static NameIdentifier[] filterByPrivilege(
.toArray(NameIdentifier[]::new);
}
+ public static Metalake[] filterMetalakes(Metalake[] metalakes, String
expression) {
+ if (!enableAuthorization()) {
+ return metalakes;
+ }
+ checkExecutor();
+ AuthorizationRequestContext authorizationRequestContext = new
AuthorizationRequestContext();
+ List<CompletableFuture<Metalake>> futures = new ArrayList<>();
+ for (Metalake metalake : metalakes) {
+ Principal currentPrincipal = PrincipalUtils.getCurrentPrincipal();
+ futures.add(
+ CompletableFuture.supplyAsync(
+ () -> {
+ try {
+ return PrincipalUtils.doAs(
+ currentPrincipal,
+ () -> {
+ Map<Entity.EntityType, NameIdentifier>
nameIdentifierMap =
+ spiltMetadataNames(
Review Comment:
fixed
##########
server-common/src/main/java/org/apache/gravitino/server/authorization/MetadataAuthzHelper.java:
##########
@@ -88,6 +89,46 @@ public static NameIdentifier[] filterByPrivilege(
.toArray(NameIdentifier[]::new);
}
+ public static Metalake[] filterMetalakes(Metalake[] metalakes, String
expression) {
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]