@Override
  public InputStream readAsCurrent(String spec, String requestMethod, InputStream body, Map<String, String> headers)
      throws IOException {

    return readAs(spec, requestMethod, body, headers, viewContext.getUsername());
  }
Get an instance of HostPortRestrictionHandler

@return
ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java