-
Notifications
You must be signed in to change notification settings - Fork 515
[#6695] fix(authz): Fix the error privileges #6821
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
Conversation
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.
Don‘t forget to delete these defines.
public class PathBasedMetadataObject implements AuthorizationMetadataObject {
public static final PathType METALAKE_PATH = new PathType(MetadataObject.Type.METALAKE);
public static final PathType CATALOG_PATH = new PathType(MetadataObject.Type.CATALOG);
public static final PathType SCHEMA_PATH = new PathType(MetadataObject.Type.SCHEMA);
public static final PathType TABLE_PATH = new PathType(MetadataObject.Type.TABLE);
public static final PathType FILESET_PATH = new PathType(MetadataObject.Type.FILESET);
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.
cc @yuqi1129 This follows yu's suggestion.
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.
some minor issues, others LGTM
@@ -740,4 +776,39 @@ protected Map<String, String> getServiceConfigs(Map<String, String> config) { | |||
RangerAuthorizationProperties.FS_DEFAULT_VALUE)) | |||
.build(); | |||
} | |||
|
|||
private interface PathExtractor { | |||
String getPath(Entity.EntityType type, String location); |
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.
Please add some comments regarding the method and its corresponding parameters.
return location; | ||
} else { | ||
throw new AuthorizationPluginException( | ||
"Don't support %s to get table or fileset location", type); |
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.
It's not allowed/supported to extract table or fileset path from entity %s
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.
Done.
@@ -92,15 +92,26 @@ public String toString() { | |||
private final String name; | |||
private final String parent; | |||
private final String path; | |||
private final boolean isRecursive; |
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.
I do like the name isRecursive
, you may use recursive
instead as there exists a method name isRecursive()
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.
Done.
### What changes were proposed in this pull request? Fix the error privileges. ### Why are the changes needed? Fix: apache#6695 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Add UT.
### What changes were proposed in this pull request? Fix the error privileges. ### Why are the changes needed? Fix: apache#6695 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Add UT.
### What changes were proposed in this pull request? Fix the error privileges. ### Why are the changes needed? Fix: apache#6695 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Add UT.
Fix the error privileges. Fix: apache#6695 No. Add UT.
What changes were proposed in this pull request?
Fix the error privileges.
Why are the changes needed?
Fix: #6695
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Add UT.