private Mode.Bits getPermissionInternal(String user, List<String> groups, String path,
      List<InodeView> inodeList) {
    int size = inodeList.size();
    Preconditions.checkArgument(size > 0,
        PreconditionMessage.EMPTY_FILE_INFO_LIST_FOR_PERMISSION_CHECK);

    // bypass checking permission for super user or super group of Alluxio file system.
    if (isPrivilegedUser(user, groups)) {
      return Mode.Bits.ALL;
    }

    // traverses from root to the parent dir to all inodes included by this path are executable
    for (int i = 0; i < size - 1; i++) {
      try {
        checkInode(user, groups, inodeList.get(i), Mode.Bits.EXECUTE, path);
      } catch (AccessControlException e) {
        return Mode.Bits.NONE;
      }
    }

    InodeView inode = inodeList.get(inodeList.size() - 1);
    if (inode == null) {
      return Mode.Bits.NONE;
    }

    return inode.getPermission(user, groups).toModeBits();
  }
private Mode . Bits getPermissionInternal ( String user , List < String > groups , String path , List < InodeView > inodeList ) { int size = inodeList . size ( ) ; Preconditions . checkArgument ( size > 0 , PreconditionMessage . EMPTY_FILE_INFO_LIST_FOR_PERMISSION_CHECK ) ; if ( isPrivilegedUser ( user , groups ) ) { return Mode . Bits . ALL ; } for ( int i = 0 ; i < size - 1 ; i ++ ) { try { checkInode ( user , groups , inodeList . get ( i ) , Mode . Bits . EXECUTE , path ) ; } catch ( AccessControlException e ) { return Mode . Bits . NONE ; } } InodeView inode = inodeList . get ( inodeList . size ( ) - 1 ) ; if ( inode == null ) { return Mode . Bits . NONE ; } return inode . getPermission ( user , groups ) . toModeBits ( ) ; }
Gets the permission to access an inode path given a user and its groups.

@param user the user
@param groups the groups this user belongs to
@param path the inode path
@param inodeList the list of inodes in the path
@return the permission