Copilot commented on code in PR #12696:
URL: https://github.com/apache/gravitino/pull/12696#discussion_r3922418381


##########
lance/lance-rest-server/src/test/java/org/apache/gravitino/lance/integration/test/LanceTableAuthorizationIT.java:
##########
@@ -202,6 +265,94 @@ public void 
testCreateTablePrivilegeCannotOverwriteAnotherOwnersTable() throws E
     Assertions.assertEquals(location(HIDDEN_TABLE), describedLocation(ADMIN, 
HIDDEN_TABLE));
   }
 
+  @Test
+  public void testColumnMutationRequiresModifyTable() throws Exception {
+    // Selecting a table does not authorize changing its columns.
+    assertStatus(403, dropColumns(READER, MUTABLE_TABLE, "value"));
+    assertStatus(403, alterColumns(READER, MUTABLE_TABLE, "value", "renamed"));
+    Assertions.assertEquals(List.of("id", "value"), 
describedColumns(MUTABLE_TABLE));

Review Comment:
   In `testColumnMutationRequiresModifyTable`, the negative case uses `READER` 
against `MUTABLE_TABLE`, but `READER` is not granted `USE_SCHEMA` on 
`WRITE_SCHEMA` nor `SELECT_TABLE` on `MUTABLE_TABLE` (it only has 
`SELECT_TABLE` on `VISIBLE_TABLE` in `SCHEMA`). This means the 403 responses 
here can be caused by lack of schema/table access rather than demonstrating the 
intended property that `SELECT_TABLE` does not authorize column mutation.



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