jerqi commented on code in PR #5176:
URL: https://github.com/apache/gravitino/pull/5176#discussion_r1820319108
##########
authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java:
##########
@@ -657,20 +698,386 @@ private boolean doRemoveSecurableObject(
return true;
}
+ /**
+ * IF remove the SCHEMA, Need to remove these the relevant policies,
`{schema}`, `{schema}.*`,
+ * `{schema}.*.*` <br>
+ * IF remove the TABLE, Need to remove these the relevant policies,
`{schema}.*`, `{schema}.*.*`
+ * <br>
+ * IF remove the COLUMN, Only need to remove `{schema}.*.*` <br>
+ */
+ private void doRemoveMetadataObject(RangerMetadataObject
rangerMetadataObject) {
+ switch (rangerMetadataObject.type()) {
+ case SCHEMA:
+ doRemoveSchemaMetadataObject(rangerMetadataObject);
+ break;
+ case TABLE:
+ doRemoveTableMetadataObject(rangerMetadataObject);
+ break;
+ case COLUMN:
+ removePolicyByMetadataObject(rangerMetadataObject.names());
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Unsupported metadata object type: " +
rangerMetadataObject.type());
+ }
+ }
+
+ /**
+ * Remove the SCHEMA, Need to rename these the relevant policies,
`{schema}`, `{schema}.*`,
Review Comment:
`rename` -> `delete`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]