anchor.diff:                  children = Files
               }
           ),
  +
  +        {ComplementaryPermsPerFile, AllRequiredPerms} = get_complementary_perms(
  +            Node, PermsPerFile
  +        ),
           run_acl_perms_scenario(
  -            Node, OwnerSessId, SessId, ScenarioRootDirPath,
  -            Operation, PermsPerFile, ExtraData, AceWho, AceFlags, ScenarioType
  +            Node, OwnerSessId, SessId, ScenarioRootDirPath, ScenarioName,
  +            Operation, ComplementaryPermsPerFile, AllRequiredPerms,
  +            ExtraData, AceWho, AceFlags, ScenarioType
           )
       end, [
  -        {OwnerSessId, allow, <<"owner_acl_allow">>, ?owner, ?no_flags_mask},
  -        {UserSessId, allow, <<"user_acl_allow">>, SpaceUser, ?no_flags_mask},
  -        {UserSessId, allow, <<"user_group_acl_allow">>, SpaceUserGroup, ?identifier_group_mask},
  -        {UserSessId, allow, <<"everyone_acl_allow">>, ?everyone, ?no_flags_mask},
  -
  -        {OwnerSessId, deny, <<"owner_acl_deny">>, ?owner, ?no_flags_mask},
  -        {UserSessId, deny, <<"user_acl_deny">>, SpaceUser, ?no_flags_mask},
  -        {UserSessId, deny, <<"user_group_acl_deny">>, SpaceUserGroup, ?identifier_group_mask},
  -        {UserSessId, deny, <<"everyone_acl_deny">>, ?everyone, ?no_flags_mask}
  +        {OwnerSessId, allow, <<"acl_owner_allow">>, ?owner, ?no_flags_mask},
  +        {UserSessId, allow, <<"acl_user_allow">>, SpaceUser, ?no_flags_mask},
  +        {UserSessId, allow, <<"acl_user_group_allow">>, SpaceUserGroup, ?identifier_group_mask},
  +        {UserSessId, allow, <<"acl_everyone_allow">>, ?everyone, ?no_flags_mask},
  +
  +        {OwnerSessId, deny, <<"acl_owner_deny">>, ?owner, ?no_flags_mask},
  +        {UserSessId, deny, <<"acl_user_deny">>, SpaceUser, ?no_flags_mask},
  +        {UserSessId, deny, <<"acl_user_group_deny">>, SpaceUserGroup, ?identifier_group_mask},
  +        {UserSessId, deny, <<"acl_everyone_deny">>, ?everyone, ?no_flags_mask}
       ]).
   
   
   run_acl_perms_scenario(
  -    Node, OwnerSessId, SessId, TestCaseRootDirPath,
  -    Operation, RequiredPermsPerFile, ExtraData, AceWho, AceFlags, Type
  -) ->
  -    {ComplementaryPermsPerFile, AllRequiredPerms} = maps:fold(
  -        fun(FileGuid, FileRequiredPerms, {BasePermsPerFileAcc, RequiredPermsAcc}) ->
  -            {
  -                BasePermsPerFileAcc#{FileGuid => lfm_permissions_test_utils:complementary_perms(
  -                    Node, FileGuid, FileRequiredPerms
  -                )},
  -                [{FileGuid, Perm} || Perm <- FileRequiredPerms] ++ RequiredPermsAcc
  -            }
  -        end,
  -        {#{}, []},
  -        RequiredPermsPerFile
  -    ),
  -
  -    try
  -        run_acl_tests(
  -            Node, OwnerSessId, SessId, TestCaseRootDirPath,
  -            Operation, ComplementaryPermsPerFile, AllRequiredPerms,
  -            ExtraData, AceWho, AceFlags, Type
  -        )
  -    catch T:R ->
  -        RequiredPermsPerFileMap = maps:fold(fun(Guid, RequiredPerms, Acc) ->
  -            lfm_proxy:set_perms(Node, ?ROOT_SESS_ID, {guid, Guid}, 8#777),
  -            case lfm_proxy:get_file_path(Node, OwnerSessId, Guid) of
  -                {ok, Path} -> Acc#{Path => RequiredPerms};
  -                _ -> Acc#{Guid => RequiredPerms}
  -            end
  -        end, #{}, RequiredPermsPerFile),
  -
  -        ct:pal(
  -            "ACL TESTS FAILURE~n"
  -            "   Type: ~p~n"
  -            "   Root path: ~p~n"
  -            "   Required Perms: ~p~n"
  -            "   Identifier: ~p~n"
  -            "   Is group identifier: ~p~n"
  -            "   Stacktrace: ~p~n",
  -            [
  -                Type, TestCaseRootDirPath,
  -                RequiredPermsPerFileMap,
  -                AceWho, AceFlags == ?identifier_group_mask,
  -                erlang:get_stacktrace()
  -            ]
  -        ),
  -        erlang:T(R)
  -    end.
  -
  -
  -run_acl_tests(
  -    Node, OwnerSessId, SessId, TestCaseRootDirPath, Operation,
  +    Node, OwnerSessId, SessId, ScenarioRootDirPath, ScenarioName, Operation,
       ComplementaryPermsPerFile, AllRequiredPerms, ExtraData, AceWho, AceFlags, allow
   ) ->
       [AllRequiredPermsComb | EaccesPermsCombs] = combinations(AllRequiredPerms),
   
  -    % Granting all perms without required ones should result in eacces
  -    lists:foreach(fun(EaccessPermComb) ->
  +    % Granting all perms without required ones should result in {error, ?EACCES}
  +    lists:foreach(fun(EaccesPermComb) ->
           EaccesPermsPerFile = lists:foldl(fun({Guid, Perm}, Acc) ->
               Acc#{Guid => [Perm | maps:get(Guid, Acc)]}
  -        end, ComplementaryPermsPerFile, EaccessPermComb),
  -        lfm_permissions_test_utils:set_acls(Node, EaccesPermsPerFile, #{}, AceWho, AceFlags),
  -        ?assertMatch(
  +        end, ComplementaryPermsPerFile, EaccesPermComb),
  +
  +        lfm_permissions_test_utils:set_acls(
  +            Node, EaccesPermsPerFile, #{}, AceWho, AceFlags
  +        ),
  +        ?assert_match(
               {error, ?EACCES},
  -            Operation(OwnerSessId, SessId, TestCaseRootDirPath, ExtraData)
  +            Operation(OwnerSessId, SessId, ScenarioRootDirPath, ExtraData),
  +            ScenarioName,
  +            EaccesPermsPerFile
           )
       end, EaccesPermsCombs),
   
  
positive.code:         )
      catch T:R ->
          FilePathsToRequiredPerms = maps:fold(fun(Guid, RequiredPerms, Acc) ->
              lfm_proxy:set_perms(Node, ?ROOT_SESS_ID, {guid, Guid}, 8#777),
              case lfm_proxy:get_file_path(Node, OwnerSessId, Guid) of
                  {ok, Path} -> Acc#{Path => RequiredPerms};
                  _ -> Acc#{Guid => RequiredPerms}
              end
          end, #{}, PosixPermsPerFile),
  
          ct:pal(
  
negative.code: 
      % Denying only required perms and granting all others should result in eacces
      lists:foreach(fun({Guid, Perm}) ->
          EaccesPermsPerFile = #{Guid => [Perm]},
  
          lfm_permissions_test_utils:set_acls(
              Node, AllPermsPerFile, EaccesPermsPerFile, AceWho, AceFlags
          ),
          ?assert_match(
              {error, ?EACCES},
              Operation(OwnerSessId, SessId, ScenarioRootDirPath, ExtraData),
              ScenarioName,
              EaccesPermsPerFile
          )
      end, AllRequiredPerms),
  
      % Denying all perms but required ones should result in success
      lfm_permissions_test_utils:set_acls(
          Node, #{}, ComplementaryPermsPerFile, AceWho, AceFlags
      ),
      ?assert_not_match(
          {error, _},
          Operation(OwnerSessId, SessId, ScenarioRootDirPath, ExtraData),
          ScenarioName,
          ComplementaryPermsPerFile
      ).
  
  
  get_complementary_perms(Node, PermsPerFile)->
      maps:fold(fun(FileGuid, FileRequiredPerms, {BasePermsPerFileAcc, RequiredPermsAcc}) ->
          {
              BasePermsPerFileAcc#{FileGuid => lfm_permissions_test_utils:complementary_perms(
                  Node, FileGuid, FileRequiredPerms
              )},
              [{FileGuid, Perm} || Perm <- FileRequiredPerms] ++ RequiredPermsAcc
          }
      end, {#{}, []}, PermsPerFile).
  
  
  %%%===================================================================
  