Two agreeing parties can agree to whatever terms they want. There is no "requirement" for a judge to approve terms that two parties agreed to. It's only if a judge himself imposes a ban is there requirements for him to impose it. But in this case, he's not imposing a thing.