-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add public psuedo role to resource grant #524
Conversation
func (b *MaterializeRole) QualifiedName() string { | ||
// If role name is PUBLIC, it should not be quoted as it is a pseudo-role | ||
if b.name == "PUBLIC" { | ||
return b.name | ||
} | ||
return QualifiedName(b.name) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is essentially the main change, the rest is just tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pp := `WHERE mz_clusters.id = 'u1'` | ||
testhelpers.MockClusterScan(mock, pp) | ||
|
||
if err := grantClusterCreate(context.TODO(), d, db); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what does context.TODO()
do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jun 🙌
The context.TODO()
returns a non-nil, empty Context. It is just used as a placeholder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
It looks like that we used to be generating the following:
This PR checks if the role is
PUBLIC
and if so, it does not quote it.