anchor.diff:  %% @end
   %%--------------------------------------------------------------------
   -spec expand_traverse_ancestors_check(file_meta:doc() | undefined, file_meta:doc() | undefined,
  -    od_user:doc(), od_share:id() | undefined, maps:map()) ->
  +    od_user:doc(), od_share:id() | undefined) ->
       [{check_type(), datastore:document(), datastore:document(), od_share:id() | undefined, [#accesscontrolentity{}]}].
  -expand_traverse_ancestors_check(SubjectDoc, ParentDoc,
  -    UserDoc = #document{key = UserId}, ShareId, AclMap) ->
  -
  +expand_traverse_ancestors_check(SubjectDoc, ParentDoc, UserDoc = #document{key = UserId}, ShareId) ->
       NewSubjDoc =
           case SubjectDoc =/= undefined andalso SubjectDoc#document.value#file_meta.is_scope of
               true ->
  
positive.code: before_advice(#annotation{data = AccessDefinitions}, _M, _F, Args = [UserCtx, File | _]) ->
      UserId = user_ctx:get_user_id(UserCtx),
      ShareId = file_ctx:get_share_id_const(File),
      ExpandedAccessDefinitions = expand_access_definitions(AccessDefinitions, UserId, ShareId, Args, #{}, #{}, #{}),
      lists:foreach(fun check_rule_and_cache_result/1, ExpandedAccessDefinitions),
      lists:foreach(fun cache_ok_result/1, ExpandedAccessDefinitions),
      Args.
  
negative.code: %%% cited in 'LICENSE.txt'.
  %%% @end
  %%%-------------------------------------------------------------------
  %%% @doc
  %%% check_permissions annotation implementation.
  %%% This annotation shall check whether annotation's caller has given
  %%% permissions to file that is also somewhere within annotation's arguments.
  %%% @end
  %%%-------------------------------------------------------------------
  -module(check_permissions).
  