@Override
  public InputStream readAs(String spec, String requestMethod, String body, Map<String, String> headers,
                            String userName)
      throws IOException {
    return readFrom(addDoAs(spec, userName), requestMethod, body, headers);
  }
Get an instance of HostPortRestrictionHandler

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