fe/src/main/java/com/cloudera/impala/util/FSPermissionChecker.java
/**
   * Checks whether the current user has permission to access the given Path at the
   * specified access level.
   */
Checks whether the current user has permission to access the given Path at the
specified access level.
Checks whether the current user has permission to access the given Path at the specified access level .
public boolean hasAccess(FileSystem fs, Path path, FsAction access)
      throws IOException {
    Preconditions.checkNotNull(path);
    Preconditions.checkNotNull(access);
    FileStatus fileStatus = fs.getFileStatus(path);
    FsPermission mode = fileStatus.getPermission();
    if (user_.equals(fileStatus.getOwner())) { 
      if (mode.getUserAction().implies(access)) { return true; }
    } else if (groups_.contains(fileStatus.getGroup())) { 
      if (mode.getGroupAction().implies(access)) { return true; }
    } else { 
      if (mode.getOtherAction().implies(access)) { return true; }
    }
    return false;
  }
public boolean hasAccess ( FileSystem fs , Path path , FsAction access ) throws IOException { Preconditions . checkNotNull ( path ) ; Preconditions . checkNotNull ( access ) ; FileStatus fileStatus = fs . getFileStatus ( path ) ; FsPermission mode = fileStatus . getPermission ( ) ; if ( user_ . equals ( fileStatus . getOwner ( ) ) ) { if ( mode . getUserAction ( ) . implies ( access ) ) { return true ; } } else if ( groups_ . contains ( fileStatus . getGroup ( ) ) ) { if ( mode . getGroupAction ( ) . implies ( access ) ) { return true ; } } else { if ( mode . getOtherAction ( ) . implies ( access ) ) { return true ; } } return false ; }
Checks whether the current user has permission to access the given Path at the
 specified access level.
Checks whether the current user has permission to access the given Path at the specified access level .
//user class //group class //other class