@InterfaceAudience.LimitedPrivate("hive")
  public static boolean isInstrumentationAccessAllowed(
          ServletContext servletContext, HttpServletRequest request,
          HttpServletResponse response) throws IOException {
    Configuration conf =
      (Configuration) servletContext.getAttribute(CONF_CONTEXT_ATTRIBUTE);

    boolean access = true;
    boolean adminAccess = conf.getBoolean(
      CommonConfigurationKeys.HADOOP_SECURITY_INSTRUMENTATION_REQUIRES_ADMIN,
      false);
    if (adminAccess) {
      access = hasAdministratorAccess(servletContext, request, response);
    }
    return access;
  }
Checks the user has privileges to access to instrumentation servlets.
<p>
If <code>hadoop.security.instrumentation.requires.admin</code> is set to FALSE
(default value) it always returns TRUE.
</p>
<p>
If <code>hadoop.security.instrumentation.requires.admin</code> is set to TRUE
it will check if the current user is in the admin ACLS. If the user is
in the admin ACLs it returns TRUE, otherwise it returns FALSE.
</p>

@param servletContext the servlet context.
@param request the servlet request.
@param response the servlet response.
@return TRUE/FALSE based on the logic described above.
common/src/java/org/apache/hive/http/HttpServer.java