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
2 changes: 1 addition & 1 deletion pkg/ddl/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6267,7 +6267,7 @@ func (e *executor) DropResourceGroup(ctx sessionctx.Context, stmt *ast.DropResou
if checker == nil {
return errors.New("miss privilege checker")
}
user, matched := checker.MatchUserResourceGroupName(groupName.L)
user, matched := checker.MatchUserResourceGroupName(ctx.GetRestrictedSQLExecutor(), groupName.L)
if matched {
err = errors.Errorf("user [%s] depends on the resource group to drop", user)
return err
Expand Down
1 change: 1 addition & 0 deletions pkg/privilege/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ go_library(
"//pkg/sessionctx",
"//pkg/sessionctx/variable",
"//pkg/types",
"//pkg/util/sqlexec",
],
)
3 changes: 2 additions & 1 deletion pkg/privilege/privilege.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/pingcap/tidb/pkg/sessionctx"
"github.com/pingcap/tidb/pkg/sessionctx/variable"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/sqlexec"
)

type keyType int
Expand Down Expand Up @@ -100,7 +101,7 @@ type Manager interface {
MatchIdentity(user, host string, skipNameResolve bool) (string, string, bool)

// MatchUserResourceGroupName matches a user with specified resource group name
MatchUserResourceGroupName(resourceGroupName string) (string, bool)
MatchUserResourceGroupName(exec sqlexec.RestrictedSQLExecutor, resourceGroupName string) (string, bool)

// DBIsVisible returns true is the database is visible to current user.
DBIsVisible(activeRole []*auth.RoleIdentity, db string) bool
Expand Down
1 change: 1 addition & 0 deletions pkg/privilege/privileges/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ go_library(
"//pkg/util/sqlescape",
"//pkg/util/sqlexec",
"//pkg/util/stringutil",
"@com_github_google_btree//:btree",
"@com_github_lestrrat_go_jwx_v2//jwk",
"@com_github_lestrrat_go_jwx_v2//jws",
"@com_github_lestrrat_go_jwx_v2//jwt",
Expand Down
Loading