static boolean userHasAdministratorAccess(ServletContext servletContext,
      String remoteUser) {
    AccessControlList adminsAcl = (AccessControlList) servletContext
        .getAttribute(ADMINS_ACL);
    UserGroupInformation remoteUserUGI =
        UserGroupInformation.createRemoteUser(remoteUser);
    return adminsAcl != null && adminsAcl.isUserAllowed(remoteUserUGI);
  }
Get the admin ACLs from the given ServletContext and check if the given
user is in the ACL.

@param servletContext the context containing the admin ACL.
@param remoteUser the remote user to check for.
@return true if the user is present in the ACL, false if no ACL is set or
        the user is not present
common/src/java/org/apache/hive/http/HttpServer.java