You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "luozenglin (via GitHub)" <gi...@apache.org> on 2023/06/05 03:01:46 UTC

[GitHub] [doris] luozenglin commented on a diff in pull request #20242: [feature-wip](workload-group) Support for workload group Authentication

luozenglin commented on code in PR #20242:
URL: https://github.com/apache/doris/pull/20242#discussion_r1217394459


##########
fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java:
##########
@@ -133,6 +135,19 @@ public QueryQueue getWorkloadGroupQueryQueue(String groupName) throws UserExcept
         }
     }
 
+    private String getWorkloadGroupName(ConnectContext context) throws AnalysisException {
+        String groupName = context.getSessionVariable().getWorkloadGroup();
+        if (Strings.isNullOrEmpty(groupName)) {
+            groupName = Env.getCurrentEnv().getAuth().getWorkloadGroup(context.getQualifiedUser());
+        }
+        if (!Env.getCurrentEnv().getAccessManager().checkWorkloadGroupPriv(context, groupName, PrivPredicate.USAGE)) {
+            ErrorReport.reportAnalysisException(
+                    "Access denied; you need (at least one of) the %s privilege(s) to use workload group '%s'.",

Review Comment:
   already done this



-- 
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-unsubscribe@doris.apache.org

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


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