anchor.diff:              true -> [?SPACE_QUERY_INDICES];
               false -> []
           end,
  -        RequiredPrivs = TransferPrivs ++ IndexPrivs,
  +        RequiredPrivs = lists:sort(TransferPrivs ++ IndexPrivs),
   
           SpacePrivs = AllSpacePrivs -- RequiredPrivs,
           ErrorForbidden = rest_test_utils:get_rest_error(?ERROR_FORBIDDEN),
   
  -        initializer:testmaster_mock_space_user_privileges([Worker], SpaceId, User, SpacePrivs),
  -        {ok, Code1, _, Resp1} = rest_test_utils:request(Worker, HTTPPath, post, Headers, []),
  -        ?assertMatch(ErrorForbidden, {Code1, json_utils:decode(Resp1)}),
  +        lists:foreach(fun
  +            (PrivsToAdd) when PrivsToAdd =:= RequiredPrivs ->
  +                % success will be checked later
  +                ok;
  +            (PrivsToAdd) ->
  +                initializer:testmaster_mock_space_user_privileges([Worker], SpaceId, User, SpacePrivs ++ PrivsToAdd),
  +                {ok, Code, _, Resp} = rest_test_utils:request(Worker, HTTPPath, post, Headers, []),
  +                ?assertMatch(ErrorForbidden, {Code, json_utils:decode(Resp)})
  +        end, combinations(RequiredPrivs)),
   
           initializer:testmaster_mock_space_user_privileges([Worker], SpaceId, User, SpacePrivs ++ RequiredPrivs),
           {ok, _, _, Body} = ?assertMatch(
  
positive.code:                 <<"replicas/", FilePath/binary, "?provider_id=", ProviderId/binary,
                      "&migration_provider_id=", MigrationProviderId/binary
                  >>,
                  [?SPACE_SCHEDULE_REPLICATION, ?SPACE_SCHEDULE_EVICTION]
              }
      end,
      Headers = [?USER_TOKEN_HEADER(Config, User)],
  
negative.code:     ErrorForbidden = rest_test_utils:get_rest_error(?ERROR_FORBIDDEN),
  
      try
          lists:foreach(fun
              (PrivsToAdd) when PrivsToAdd =:= RequiredPrivs ->
                  % success will be checked later
                  ok;
              (PrivsToAdd) ->
                  initializer:testmaster_mock_space_user_privileges([Worker], SpaceId, User, SpacePrivs ++ PrivsToAdd),
                  {ok, Code, _, Resp} = rest_test_utils:request(Worker, URL, delete, Headers, []),
                  ?assertMatch(ErrorForbidden, {Code, json_utils:decode(Resp)})
          end, combinations(RequiredPrivs)),
  
          initializer:testmaster_mock_space_user_privileges([Worker], SpaceId, User, SpacePrivs ++ RequiredPrivs),
          case rest_test_utils:request(Worker, URL, delete, Headers, []) of
  