wangbo commented on code in PR #38436:
URL: https://github.com/apache/doris/pull/38436#discussion_r1696836762


##########
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/RoleManager.java:
##########
@@ -211,6 +212,31 @@ public void getRoleInfo(List<List<String>> results) {
         }
     }
 
+    public void getRoleWorkloadGroupPrivs(List<List<String>> result, 
Set<String> limitedRole) {
+        for (Role role : roles.values()) {
+            if 
(ClusterNamespace.getNameFromFullName(role.getRoleName()).startsWith(DEFAULT_ROLE_PREFIX))
 {
+                continue;
+            }
+
+            if (limitedRole != null && 
!limitedRole.contains(role.getRoleName())) {
+                continue;
+            }
+            String isGrantable = Auth.isAdminPriv(role.getGlobalPrivTable()) ? 
"YES" : "NO";

Review Comment:
   ```checkGlobalPriv``` can only check user is admin, but it can not check 
whether a role has granted privilege.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to