@Override
      public TableName call() throws Exception {
        try (Connection conn = getConnection()) {
          final Admin admin = conn.getAdmin();
          final TableName tn = helper.createTableWithRegions(admin, 5);
          final long sizeLimit = 2L * SpaceQuotaHelperForTests.ONE_MEGABYTE;
          QuotaSettings settings = QuotaSettingsFactory.limitTableSpace(tn, sizeLimit,
            SpaceViolationPolicy.NO_WRITES_COMPACTIONS);
          admin.setQuota(settings);
          // Grant the normal user permission to create a table and set a quota
          try {
            AccessControlClient.grant(conn, tn, REGULARUSER_NAME, null, null, Action.READ,
              Action.WRITE);
          } catch (Throwable t) {
            if (t instanceof Exception) {
              throw (Exception) t;
            }
            throw new Exception(t);
          }
          return tn;
        }
      }
Test class to verify that the HBase superuser can override quotas.
hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java