Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

privilege, executor: add `SET ROLE` and `CURRENT_ROLE` support #9581

Merged
merged 15 commits into from Mar 21, 2019

add role check

  • Loading branch information...
imtbkcat committed Mar 7, 2019
commit 231736f3b0fe419f528d6a149b8d32f131605b3c
@@ -138,7 +138,8 @@ type MySQLPrivilege struct {
// FindRole is used to detect whether this is an edge between user and role
This conversation was marked as resolved by tiancaiamao

This comment has been minimized.

Copy link
@tiancaiamao

tiancaiamao Mar 12, 2019

Contributor

s/this is/there is

func (p *MySQLPrivilege) FindRole(user string, host string, role *auth.RoleIdentity) bool {
rec := p.matchUser(user, host)
if rec != nil && role != nil {
r := p.matchUser(role.Username, role.Hostname)
if rec != nil && r != nil {
key := rec.User + "@" + rec.Host
return p.RoleGraph[key].Find(role.Username, role.Hostname)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.