hello-stephen commented on code in PR #69977:
URL: https://github.com/apache/doris/pull/69977#discussion_r4794420032
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/RefreshMTMVInfo.java:
##########
@@ -89,8 +89,8 @@ public RefreshMTMVInfo(TableNameInfo mvName, List<String>
partitions, RefreshMod
public void analyze(ConnectContext ctx) {
mvName.analyze(ctx.getNameSpaceContext());
if (!Env.getCurrentEnv().getAccessManager().checkTblPriv(ctx,
mvName.getCtl(), mvName.getDb(),
- mvName.getTbl(), PrivPredicate.CREATE)) {
- String message =
ErrorCode.ERR_TABLEACCESS_DENIED_ERROR.formatErrorMsg("CREATE",
+ mvName.getTbl(), PrivPredicate.ALTER_CREATE)) {
Review Comment:
[P1] Enforce caller read authorization for refresh dry run.
`RefreshMTMVCommand.run` uses this gate for both job submission and incremental
dry run. The dry run plans and executes the delta query under the internal
ADMIN context and streams the rows to the caller. An ALTER-only grant on a
correctly qualified internal MV now passes that gate without a SELECT grant,
and the preview can include pending values absent from the materialized view.
Keep the management privilege for job submission and enforce the caller's read
permissions and policies before returning preview rows.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/PauseMTMVInfo.java:
##########
@@ -48,8 +48,8 @@ public PauseMTMVInfo(TableNameInfo mvName) {
public void analyze(ConnectContext ctx) {
mvName.analyze(ctx.getNameSpaceContext());
if
(!Env.getCurrentEnv().getAccessManager().checkTblPriv(ConnectContext.get(),
mvName.getCtl(), mvName.getDb(),
- mvName.getTbl(), PrivPredicate.CREATE)) {
- String message =
ErrorCode.ERR_TABLEACCESS_DENIED_ERROR.formatErrorMsg("CREATE",
+ mvName.getTbl(), PrivPredicate.ALTER_CREATE)) {
Review Comment:
[P1] Authorize the same catalog that owns the MTMV. The privilege check uses
`mvName.getCtl()`. Analysis and `MTMVJobManager.getJobByTableNameInfo` both
resolve the view in the internal catalog. The added ALTER alternative extends
the existing mismatch to callers whose ALTER grant is scoped to an external
catalog. That grant can authorize pause, resume, refresh, or cancel on a
matching internal view outside the caller’s grant scope. Reject non-internal
targets before authorization or bind the privilege check and operation to the
same internal view.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]