public void requireAccess(User user, String request, TableName tableName, Action... permissions)
    throws IOException {
    AuthResult result = null;

    for (Action permission : permissions) {
      if (authManager.accessUserTable(user, tableName, permission)) {
        result = AuthResult.allow(request, "Table permission granted", user, permission, tableName,
          null, null);
        break;
      } else {
        // rest of the world
        result = AuthResult.deny(request, "Insufficient permissions", user, permission, tableName,
          null, null);
      }
    }
    logResult(result);
    if (!result.isAllowed()) {
      throw new AccessDeniedException("Insufficient permissions " + result.toContextString());
    }
  }
Authorizes that the current user has any of the given permissions to access the table.
@param user        Active user to which authorization checks should be applied
@param request     Request type.
@param tableName   Table requested
@param permissions Actions being requested
@throws IOException           if obtaining the current user fails
@throws AccessDeniedException if user has no authorization
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessChecker.java