private static boolean userHasProxyPrivilege(String user, Configuration conf) {
    try {
      if (MetaStoreServerUtils.checkUserHasHostProxyPrivileges(user, conf, HMSHandler.getIPAddress())) {
        LOG.info("user {} has host proxy privilege.", user);
        return true;
      }
    } catch (Exception ex) {
      // if can not decide on the proxy privilege status, then proceed with authorization check.
      LOG.warn("Cannot obtain username to check for host proxy privilege", ex);
    }
    return false;
  }
Make sure that the warehouse variable is set up properly.
@throws MetaException if unable to instantiate
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/StorageBasedAuthorizationProvider.java