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: Users can only see the workload groups they have privileges to, so I don't think it's necessary to authenticate when setting session variables, and it's a bit strange to do so -- 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