Skip to content

Commit

Permalink
[branch-2.0](cherry-pick)node priv can show proc apache#32751 (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
zddr authored and weixingyu12 committed Apr 8, 2024
1 parent 91eb062 commit 9dbe0d3
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 9dbe0d3

Please sign in to comment.