private String getTempletonUser(ViewContext context) {
    String username = context.getProperties().get("webhcat.username");
    if (username == null || username.compareTo("null") == 0 || username.compareTo("") == 0) {
      username = context.getUsername();
    }
    return username;
  }
Extension point to use different usernames in templeton
requests instead of logged in user
@return username in templeton
contrib/views/pig/src/main/java/org/apache/ambari/view/pig/templeton/client/TempletonApiFactory.java