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


##########
core/src/main/java/org/apache/gravitino/authorization/UserGroupManager.java:
##########
@@ -109,6 +113,25 @@ User getUser(String metalake, String user) throws 
NoSuchUserException {
     }
   }
 
+  String[] listUserNames(String metalake) {
+    return 
Arrays.stream(listUsers(metalake)).map(User::name).toArray(String[]::new);
+  }
+
+  User[] listUsers(String metalake) {
+    try {
+      Namespace namespace = AuthorizationUtils.ofUserNamespace(metalake);
+      return store.list(namespace, UserEntity.class, 
Entity.EntityType.USER).stream()
+          .map(entity -> (User) entity)

Review Comment:
   You can see the pull request. https://github.com/apache/gravitino/pull/4690
   UserEntity `roles` field don't be fetched directly. We will put a supplier 
method field instead. So we don't fetch the values directly if we only need the 
names.
   If we need all the information of entities, we can also have the ability to 
put them. You can see the list details. Because the front side need the all the 
users information, so I provide the interface.



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