verifyDenied(getTableDescAction, USER_RW, USER_RO, USER_NONE);
}
@Test
public void testTableDeletion() throws Exception {
final User tableAdmin = User.createUserForTesting(conf, "TestUser", new String[0]);
// We need to create a new table here because we will be testing what
// happens when it is deleted
final byte[] tableName = Bytes.toBytes("testTableDeletion");
HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
HTableDescriptor htd = new HTableDescriptor(tableName);
htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
admin.createTable(htd);
TEST_UTIL.waitTableEnabled(tableName, 5000);
// Grant TABLE ADMIN privs
HTable acl = new HTable(conf, AccessControlLists.ACL_TABLE_NAME);
try {
AccessControllerProtocol protocol = acl.coprocessorProxy(
AccessControllerProtocol.class, tableName);
protocol.grant(new UserPermission(Bytes.toBytes(tableAdmin.getShortName()),
tableName, null, Permission.Action.ADMIN));
} finally {
acl.close();
}