Skip to content

Commit

Permalink
[branch-2.0](cherry-pick)node priv can show proc #32751 (#32826)
Browse files Browse the repository at this point in the history
pick #32751
  • Loading branch information
zddr authored Mar 27, 2024
1 parent d8a3d9a commit 4d80df1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public ProcNodeInterface getNode() {

@Override
public void analyze(Analyzer analyzer) throws AnalysisException {
if (!Env.getCurrentEnv().getAccessManager().checkGlobalPriv(ConnectContext.get(), PrivPredicate.ADMIN)) {
if (!Env.getCurrentEnv().getAccessManager()
.checkGlobalPriv(ConnectContext.get(), PrivPredicate.ADMIN_OR_NODE)) {
ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, "ADMIN");
}
node = ProcService.getInstance().open(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public class PrivPredicate {
public static final PrivPredicate ADMIN = PrivPredicate.of(PrivBitSet.of(Privilege.ADMIN_PRIV),
Operator.OR);

public static final PrivPredicate ADMIN_OR_NODE = PrivPredicate.of(
PrivBitSet.of(Privilege.ADMIN_PRIV, Privilege.NODE_PRIV),
Operator.OR);

// load
public static final PrivPredicate LOAD = PrivPredicate.of(PrivBitSet.of(Privilege.ADMIN_PRIV,
Privilege.LOAD_PRIV),
Expand Down

0 comments on commit 4d80df1

Please sign in to comment.