Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public static void checkDatabase(String dbName, ConnectContext ctx) throws Analy
if (!FeConstants.INTERNAL_DB_NAME.equals(dbName)) {
return;
}
if (ctx == null || ctx.getCurrentUserIdentity() == null || !ctx.getCurrentUserIdentity().isRootUser()) {
if (ctx == null || ctx.getCurrentUserIdentity() == null
|| !ctx.getCurrentUserIdentity().isRootUser() && !ctx.getCurrentUserIdentity().isAdminUser()) {
throw new AnalysisException("Not allowed to operate database: " + dbName);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ public static AutoCloseConnectContext buildConnectContext(boolean limitScan) {
sessionVariable.enableUniqueKeyPartialUpdate = false;
connectContext.setEnv(Env.getCurrentEnv());
connectContext.setDatabase(FeConstants.INTERNAL_DB_NAME);
connectContext.setQualifiedUser(UserIdentity.ROOT.getQualifiedUser());
connectContext.setCurrentUserIdentity(UserIdentity.ROOT);
connectContext.setQualifiedUser(UserIdentity.ADMIN.getQualifiedUser());
connectContext.setCurrentUserIdentity(UserIdentity.ADMIN);
connectContext.setStartTime();
return new AutoCloseConnectContext(connectContext);
}
Expand Down