justinmclean commented on code in PR #5811:
URL: https://github.com/apache/gravitino/pull/5811#discussion_r1877296512


##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -382,14 +385,26 @@ protected void handleUserCommand() {
       boolean force = line.hasOption(GravitinoOptions.FORCE);
       newDeleteUser(url, ignore, force, metalake, user).handle();
     } else if (CommandActions.REVOKE.equals(command)) {
-      String role = line.getOptionValue(GravitinoOptions.ROLE);
-      if (role != null) {
-        newRemoveRoleFromUser(url, ignore, metalake, user, role).handle();
+      String[] roles = line.getOptionValues(GravitinoOptions.ROLE);
+      if (roles == null || roles.length == 0) {
+        return;
+      }
+      System.out.printf("Remove roles %s from user %s%n", 
COMMA_JOINER.join(roles), user);
+      for (String role : roles) {
+        if (role != null) {
+          newRemoveRoleFromUser(url, ignore, metalake, user, role).handle();
+        }
       }
     } else if (CommandActions.GRANT.equals(command)) {
-      String role = line.getOptionValue(GravitinoOptions.ROLE);
-      if (role != null) {
-        newAddRoleToUser(url, ignore, metalake, user, role).handle();
+      String[] roles = line.getOptionValues(GravitinoOptions.ROLE);
+      if (roles == null || roles.length == 0) {
+        return;
+      }
+      System.out.printf("Grant roles %s to user %s%n", String.join(", ", 
roles), user);
+      for (String role : roles) {
+        if (role != null) {

Review Comment:
   no need for this check



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