jerqi commented on code in PR #9018:
URL: https://github.com/apache/gravitino/pull/9018#discussion_r2544194101


##########
server/src/main/java/org/apache/gravitino/server/web/filter/GravitinoInterceptionService.java:
##########
@@ -140,28 +148,23 @@ public Object invoke(MethodInvocation methodInvocation) 
throws Throwable {
           Map<String, Object> pathParams = 
extractPathParamsFromParameters(parameters, args);
           AuthorizationExpressionEvaluator authorizationExpressionEvaluator =
               new AuthorizationExpressionEvaluator(expression);
-          boolean authorizeResult =
-              authorizationExpressionEvaluator.evaluate(
-                  metadataContext,
-                  pathParams,
-                  new AuthorizationRequestContext(),
-                  Optional.ofNullable(entityType));
+          AuthorizationRequest.RequestType requestType =
+              extractAuthorizationRequestTypeFromParameters(parameters);

Review Comment:
   Could u use a factory here?



##########
server/src/main/java/org/apache/gravitino/server/web/filter/GravitinoInterceptionService.java:
##########
@@ -140,28 +148,23 @@ public Object invoke(MethodInvocation methodInvocation) 
throws Throwable {
           Map<String, Object> pathParams = 
extractPathParamsFromParameters(parameters, args);
           AuthorizationExpressionEvaluator authorizationExpressionEvaluator =
               new AuthorizationExpressionEvaluator(expression);
-          boolean authorizeResult =
-              authorizationExpressionEvaluator.evaluate(
-                  metadataContext,
-                  pathParams,
-                  new AuthorizationRequestContext(),
-                  Optional.ofNullable(entityType));
+          AuthorizationRequest.RequestType requestType =
+              extractAuthorizationRequestTypeFromParameters(parameters);
+          executor =
+              switch (requestType) {
+                case COMMON -> new CommonAuthorizerExecutor(

Review Comment:
   Could extract these classes to single files?



-- 
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]

Reply via email to