Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-18437

Revoke access permissions of a user from a table does not work as expected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.12
    • 1.4.0, 1.3.2, 2.0.0
    • security
    • None
    • Reviewed

    Description

      A table for which a user was granted 'RW' permission. Now when we want to revoke its 'W' permission only, code removes the user itself from that table permissions.
      Below is the test code which reproduces the issue.

      @Test(timeout = 180000)
        public void testRevokeOnlySomePerms() throws Throwable {
          TableName name = TableName.valueOf("testAgain");
          HTableDescriptor htd = new HTableDescriptor(name);
          HColumnDescriptor hcd = new HColumnDescriptor("cf");
          htd.addFamily(hcd);
          createTable(TEST_UTIL, htd);
          TEST_UTIL.waitUntilAllRegionsAssigned(name);
      
          try (Connection conn = ConnectionFactory.createConnection(conf)) {
            AccessControlClient.grant(conn, name, USER_RO.getShortName(), null, null, Action.READ, Action.WRITE);
            ListMultimap<String, TablePermission> tablePermissions = AccessControlLists.getTablePermissions(conf, name);
            // hbase user and USER_RO has permis
            assertEquals(2, tablePermissions.size());
      
            AccessControlClient.revoke(conn, name, USER_RO.getShortName(), null, null, Action.WRITE);
            tablePermissions = AccessControlLists.getTablePermissions(conf, name);
            List<TablePermission> userPerm = tablePermissions.get(USER_RO.getShortName());
            assertEquals(1, userPerm.size());
      
          } finally {
            deleteTable(TEST_UTIL, name);
          }
        }
      

      Attachments

        1. HBASE-18437-v1.patch
          9 kB
          Ashish Singhi
        2. HBASE-18437.patch
          8 kB
          Ashish Singhi

        Activity

          People

            ashish singhi Ashish Singhi
            ashish singhi Ashish Singhi
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: