anchor.diff:  
   
   %% @private
  --spec list_reg_file_with_access_check(user_ctx:ctx(), file_ctx:ctx(), file_meta:list_opts()) ->
  -    {ok, [file_ctx:ctx()], file_meta:list_extended_info(), file_ctx:ctx()}.
  -list_reg_file_with_access_check(UserCtx, FileCtx, ListOpts) ->
  +-spec check_reg_file_access(user_ctx:ctx(), file_ctx:ctx()) ->
  +    ok | no_return().
  +check_reg_file_access(UserCtx, FileCtx) ->
       {CanonicalChildrenWhiteList, FileCtx2} = fslogic_authz:ensure_authorized_readdir(
           UserCtx, FileCtx, [?TRAVERSE_ANCESTORS]
       ),
  -    {Children, ExtendedInfo, FileCtx4} = file_listing:list_children(UserCtx, FileCtx2, ListOpts, CanonicalChildrenWhiteList),
  -    {ok, Children, ExtendedInfo, FileCtx4}.
  +    % throws on lack of access
  +    _ = file_listing:list_children(UserCtx, FileCtx2, #{size => 1}, CanonicalChildrenWhiteList),
  +    ok.
   
   
   %% @private
  
positive.code: list(UserCtx, FileCtx0, StartAfter, Limit, Prefix) ->
      {FilePath, FileCtx1} = file_ctx:get_canonical_path(FileCtx0),
      [_Sep, SpaceId | FilePathTokens] = filename:split(FilePath),
      OptimizedStartAfter = case Prefix of
          <<>> -> StartAfter;
          _ -> max(StartAfter, filename:dirname(Prefix))
      end,
      InitialState = #state{
          start_after_path = OptimizedStartAfter,
          relative_start_after_path_tokens = filename:split(OptimizedStartAfter),
          limit = Limit,
          current_dir_path_tokens = [SpaceId | FilePathTokens],
  
negative.code: 
  
  %% @private
  -spec process_subtree(user_ctx:ctx(), file_ctx:ctx(), state()) ->
      {progress_marker(), result()}.
  process_subtree(UserCtx, ChildCtx, #state{current_dir_path_tokens = CurrentPathTokens} = State) ->
      case get_file_attrs(UserCtx, ChildCtx) of
          #file_attr{type = ?DIRECTORY_TYPE, name = Name, guid = G} ->
              {ProgressMarker, NextChildrenRes} = process_current_dir(UserCtx, ChildCtx,
  