private void addUserPermission(Configuration conf, UserPermission userPerm, Table t)
    throws IOException {
    try {
      PermissionStorage.addUserPermission(conf, userPerm, t);
    } finally {
      t.close();
    }
  }
The PermissionStorage.addUserPermission may throw exception before closing the table.
hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java