public static void checkFileAccess(FileSystem fs, FileStatus stat, FsAction action)
      throws IOException, AccessControlException, LoginException {
    // Get the user/groups for checking permissions based on the current UGI.
    UserGroupInformation currentUgi = Utils.getUGI();
    DefaultFileAccess.checkFileAccess(fs, stat, action,
        currentUgi.getShortUserName(),
        Arrays.asList(currentUgi.getGroupNames()));
  }
Implements the default file access logic for HadoopShims.checkFileAccess(), for Hadoop
versions which do not implement FileSystem.access().
shims/common/src/main/java/org/apache/hadoop/fs/DefaultFileAccess.java