adutra commented on code in PR #3824:
URL: https://github.com/apache/polaris/pull/3824#discussion_r2832820551


##########
runtime/service/src/test/java/org/apache/polaris/service/catalog/generic/PolarisGenericTableCatalogHandlerAuthzTest.java:
##########
@@ -55,35 +53,23 @@ private GenericTableCatalogHandler newWrapper(
   }
 
   @TestFactory
-  Stream<DynamicNode> testListGenericTablesSufficientPrivileges() {
-    return doTestSufficientPrivileges(
-        "listGenericTables",
-        List.of(
-            PolarisPrivilege.TABLE_LIST,
-            PolarisPrivilege.TABLE_READ_PROPERTIES,
-            PolarisPrivilege.TABLE_WRITE_PROPERTIES,
-            PolarisPrivilege.TABLE_READ_DATA,
-            PolarisPrivilege.TABLE_WRITE_DATA,
-            PolarisPrivilege.TABLE_CREATE,
-            PolarisPrivilege.TABLE_FULL_METADATA,
-            PolarisPrivilege.CATALOG_MANAGE_CONTENT),
-        () -> newWrapper().listGenericTables(NS1A),
-        null /* cleanupAction */);
+  Stream<DynamicNode> testListGenericTablesPrivileges() {
+    return authzTestsBuilder("listGenericTables")
+        .action(() -> newWrapper().listGenericTables(NS1A))
+        .shouldPassWith(PolarisPrivilege.TABLE_LIST)
+        .shouldPassWith(PolarisPrivilege.TABLE_READ_PROPERTIES)
+        .shouldPassWith(PolarisPrivilege.TABLE_WRITE_PROPERTIES)
+        .shouldPassWith(PolarisPrivilege.TABLE_READ_DATA)
+        .shouldPassWith(PolarisPrivilege.TABLE_WRITE_DATA)
+        .shouldPassWith(PolarisPrivilege.TABLE_CREATE)
+        .shouldPassWith(PolarisPrivilege.TABLE_FULL_METADATA)
+        .shouldPassWith(PolarisPrivilege.CATALOG_MANAGE_CONTENT)
+        .shouldPassWith(PolarisPrivilege.CATALOG_MANAGE_METADATA)

Review Comment:
   Very interesting finding here: the tests actually pass with 
`CATALOG_MANAGE_METADATA` since it's a superprivilege of `TABLE_CREATE`. But 
the tests weren't testing this case. My last commit with automatic negative 
tests uncovered this oversight.



-- 
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]

Reply via email to