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


##########
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:
   Good catch, this was a real problem with the test. `READER` had no 
`USE_SCHEMA` on `WRITE_SCHEMA` and no `SELECT_TABLE` on `MUTABLE_TABLE`, so the 
403 only showed that it could not reach the table, not that `SELECT_TABLE` 
fails to authorize a column change.
   
   Fixed in 6fd5489: `READER` now holds `USE_SCHEMA` on `WRITE_SCHEMA` and 
`SELECT_TABLE` on `MUTABLE_TABLE`, and the test asserts `describe` returns 200 
for it before the two denials. The only privilege it is missing now is 
`MODIFY_TABLE`, so the denials say what the test claims.



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