public void requireNamespacePermission(User user, String request, String namespace,
    TableName tableName, Map<byte[], ? extends Collection<byte[]>> familyMap, Action... permissions)
    throws IOException {
    AuthResult result = null;

    for (Action permission : permissions) {
      if (authManager.authorizeUserNamespace(user, namespace, permission)) {
        result =
          AuthResult.allow(request, "Namespace permission granted", user, permission, namespace);
        result.getParams().setTableName(tableName).setFamilies(familyMap);
        break;
      } else {
        // rest of the world
        result = AuthResult.deny(request, "Insufficient permissions", user, permission, namespace);
        result.getParams().setTableName(tableName).setFamilies(familyMap);
      }
    }
    logResult(result);
    if (!result.isAllowed()) {
      throw new AccessDeniedException("Insufficient permissions " + result.toContextString());
    }
  }
Checks that the user has the given global or namespace permission.
@param user        Active user to which authorization checks should be applied
@param request     Request type
@param namespace   The given namespace
@param tableName   Table requested
@param familyMap   Column family map requested
@param permissions Actions being requested
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessChecker.java