diff --git a/common/src/java/org/apache/hive/http/HttpServer.java b/common/src/java/org/apache/hive/http/HttpServer.java index 0624a7e15c..6a23db47f5 100644 --- a/common/src/java/org/apache/hive/http/HttpServer.java +++ b/common/src/java/org/apache/hive/http/HttpServer.java @@ -259,7 +259,7 @@ public static boolean isInstrumentationAccessAllowed( * @return true if admin-authorized, false otherwise * @throws IOException */ - static boolean hasAdministratorAccess( + public static boolean hasAdministratorAccess( ServletContext servletContext, HttpServletRequest request, HttpServletResponse response) throws IOException { Configuration conf = diff --git a/service/src/resources/hive-webapps/hiveserver2/hiveserver2.jsp b/service/src/resources/hive-webapps/hiveserver2/hiveserver2.jsp index c0ece6da97..888dfe8781 100644 --- a/service/src/resources/hive-webapps/hiveserver2/hiveserver2.jsp +++ b/service/src/resources/hive-webapps/hiveserver2/hiveserver2.jsp @@ -18,10 +18,12 @@ */ --%> <%@ page contentType="text/html;charset=UTF-8" + import="org.apache.commons.lang.StringUtils" import="org.apache.hadoop.conf.Configuration" import="org.apache.hadoop.hive.conf.HiveConf" import="org.apache.hadoop.hive.conf.HiveConf.ConfVars" import="org.apache.hive.common.util.HiveVersionInfo" + import="org.apache.hive.http.HttpServer" import="org.apache.hive.service.cli.operation.Operation" import="org.apache.hive.service.cli.operation.SQLOperation" import="org.apache.hadoop.hive.ql.QueryInfo" @@ -40,6 +42,7 @@ Configuration conf = (Configuration)ctx.getAttribute("hive.conf"); long startcode = conf.getLong("startcode", System.currentTimeMillis()); SessionManager sessionManager = (SessionManager)ctx.getAttribute("hive.sm"); +String remoteUser = request.getRemoteUser(); %>