public String getDoAsUsername(ViewContext context) {
    String username = context.getProperties().get("webhdfs.username");
    if (username == null || username.isEmpty())
      username = context.getUsername();
    return username;
  }
Get doAs username to use in HDFS
@param context View Context instance
@return user name
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/HdfsService.java