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


##########
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:
   Yes, wildcardSearchPolies will return multiple results. So I used precise 
search now. I think it's ok now.



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