anchor.diff:      ).
   
   
  --spec posix_perm_to_mode(PosixPerm :: atom(), Type :: owner | group) ->
  +perms_to_posix_perms(Perms) ->
  +    lists:usort(lists:flatmap(
  +        fun lfm_permissions_test_utils:perm_to_posix_perms/1, Perms
  +    )).
  +
  +
  +get_complementary_posix_perms(PosixPermsPerFile)->
  +    maps:fold(fun(FileGuid, FileRequiredPerms, {BasePermsPerFileAcc, RequiredPermsAcc}) ->
  +        {
  +            BasePermsPerFileAcc#{FileGuid => ?ALL_POSIX_PERMS -- FileRequiredPerms},
  +            [{FileGuid, Perm} || Perm <- FileRequiredPerms] ++ RequiredPermsAcc
  +        }
  +    end, {#{}, []}, PosixPermsPerFile).
  +
  +
  +-spec posix_permission_to_mode(PosixPerm :: atom(), Type :: owner | group) ->
       non_neg_integer().
  -posix_perm_to_mode(read, owner) -> 8#4 bsl 6;
  -posix_perm_to_mode(write, owner) -> 8#2 bsl 6;
  -posix_perm_to_mode(exec, owner) -> 8#1 bsl 6;
  -posix_perm_to_mode(read, group) -> 8#4 bsl 3;
  -posix_perm_to_mode(write, group) -> 8#2 bsl 3;
  -posix_perm_to_mode(exec, group) -> 8#1 bsl 3;
  -posix_perm_to_mode(read, other) -> 8#4;
  -posix_perm_to_mode(write, other) -> 8#2;
  -posix_perm_to_mode(exec, other) -> 8#1;
  -posix_perm_to_mode(_, _) -> 8#0.
  +posix_permission_to_mode(read, owner)  -> 8#4 bsl 6;
  +posix_permission_to_mode(write, owner) -> 8#2 bsl 6;
  +posix_permission_to_mode(exec, owner)  -> 8#1 bsl 6;
  +posix_permission_to_mode(read, group)  -> 8#4 bsl 3;
  +posix_permission_to_mode(write, group) -> 8#2 bsl 3;
  +posix_permission_to_mode(exec, group)  -> 8#1 bsl 3;
  +posix_permission_to_mode(read, other)  -> 8#4;
  +posix_permission_to_mode(write, other) -> 8#2;
  +posix_permission_to_mode(exec, other)  -> 8#1;
  +posix_permission_to_mode(_, _)         -> 8#0.
   
   
   %%%===================================================================
  
positive.code:     files = Files,
      operation = Operation
  }, Config) ->
      OwnerSessId = ?config({session_id, {OwnerUser, ?GET_DOMAIN(Node)}}, Config),
      UserSessId = ?config({session_id, {SpaceUser, ?GET_DOMAIN(Node)}}, Config),
  
      lists:foreach(fun({SessId, ScenarioType, ScenarioName, AceWho, AceFlags}) ->
          ScenarioRootDirPath = <<
              ScenariosRootDirPath/binary,
              "/",
              ScenarioName/binary
          >>,
  
          % Create necessary file hierarchy
          {PermsPerFile, ExtraData} = create_files(
              Node, OwnerSessId, ScenariosRootDirPath, #dir{
                  name = ScenarioName,
                  perms = case RequiresTraverseAncestors of
                      true -> [?traverse_container];
  
negative.code:             }
          ),
  
          TestCaseRootDirKey = maps:get(TestCaseRootDirPath, ExtraData0),
          {ok, ShareId} = lfm_proxy:create_share(
              Node, OwnerUserSessId, TestCaseRootDirKey, ScenarioName
          ),
          ExtraData1 = maps:map(fun
              (_, {guid, FileGuid}) ->
                  {guid, file_id:guid_to_share_guid(FileGuid, ShareId)};
  