jerryshao commented on code in PR #9384:
URL: https://github.com/apache/gravitino/pull/9384#discussion_r2591683363


##########
core/src/main/java/org/apache/gravitino/authorization/AuthorizationUtils.java:
##########
@@ -229,7 +229,26 @@ public static void 
checkDuplicatedNamePrivilege(Collection<Privilege> privileges
             "Doesn't support duplicated privilege name %s with different 
condition",
             privilege.name());
       }
-      privilegeNameSet.add(privilege.name());
+      privilegeNameSet.add(replaceLegacyPrivilegeName(privilege.name()));
+    }
+  }
+
+  public static Privilege.Name replaceLegacyPrivilegeName(Privilege.Name 
privilegeName) {
+    if (privilegeName == Privilege.Name.CREATE_MODEL) {
+      return Privilege.Name.REGISTER_MODEL;
+    } else if (privilegeName == Privilege.Name.CREATE_MODEL_VERSION) {
+      return Privilege.Name.LINK_MODEL_VERSION;
+    } else {
+      return privilegeName;
+    }
+  }
+
+  public static Privilege replaceLegacyPrivilege(

Review Comment:
   What did you actually replace in this method?



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