xunliu commented on code in PR #7001:
URL: https://github.com/apache/gravitino/pull/7001#discussion_r2051888922


##########
authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationHDFSPlugin.java:
##########
@@ -204,48 +204,35 @@ protected void updatePolicyByMetadataObject(
       AuthorizationMetadataObject newAuthzMetaObject) {
     PathBasedMetadataObject newPathBasedMetadataObject =
         (PathBasedMetadataObject) newAuthzMetaObject;
-    List<RangerPolicy> oldPolicies = wildcardSearchPolies(oldAuthzMetaObject);
-    List<RangerPolicy> existNewPolicies = 
wildcardSearchPolies(newAuthzMetaObject);
-    if (oldPolicies.isEmpty()) {
+    RangerPolicy oldPolicy = findManagedPolicy(oldAuthzMetaObject);
+    RangerPolicy existNewPolicy = findManagedPolicy(newAuthzMetaObject);
+    if (oldPolicy == null) {

Review Comment:
   I not sure.
   The `wildcardSearchPolies()` will use HDFS path prefix to search Ranger 
Policy, maybe return some matching Ranger Polices. For example, When I use `/a` 
to search, will return `/a/b1`, `/a/b2` and `/a/b/c`?
   Please notice and verify this case.



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