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

[fix](auth) Fix ResourceTypeEnum Compatibility Upgrade #39288

Merged
merged 5 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -134,5 +134,9 @@ public void gsonPostProcess() throws IOException {
if ("*".equals(resourceName)) {
resourceName = "%";
}
// 2.x -> 3.0 compatibility logic
if (resourceType == null) {
resourceType = ResourceTypeEnum.GENERAL;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ public Role(String roleName, TablePattern tablePattern, PrivBitSet privs,
public Role(String roleName, ResourcePattern resourcePattern, PrivBitSet privs) throws DdlException {
this.roleName = roleName;
// grant has trans privs
// 2.x -> 3.0 compatibility logic
if (resourcePattern.getResourceType() == null) {
// 2.x not have cloud auth, so just transfer to ResourceTypeEnum.GENERAL
resourcePattern.setResourceType(ResourceTypeEnum.GENERAL);
}
switch (resourcePattern.getResourceType()) {
case GENERAL:
this.resourcePatternToPrivs.put(resourcePattern, privs);
Expand Down
Loading