code: private void checkInode(String user, List<String> groups, InodeView inode, Mode.Bits bits,
        String path) throws AccessControlException {
      if (inode == null) {
        return;
      }
      for (AclAction action : bits.toAclActionSet()) {
        if (!inode.checkPermission(user, groups, action)) {
          throw new AccessControlException(ExceptionMessage.PERMISSION_DENIED
              .getMessage(toExceptionMessage(user, bits, path, inode)));
        }
      }
    }
docs: This method checks requested permission on a given inode, represented by its fileInfo.
  
  @param user who requests access permission
  @param groups in which user belongs to
  @param inode whose attributes used for permission check logic
  @param bits requested {@link Mode.Bits} by user
  @param path the path to check permission on
  @throws AccessControlException if permission checking fails