The privacy of royal wills will be considered by the Court of Appeal after the Guardian newspaper was granted permission to challenge the decision to hear in private an application to seal Prince Philip’s will.

Following his death aged 99 last year, the Duke of Edinburgh’s will was sealed for 90 years by the president of the Family Division Sir Andrew McFarlane, who said he initially thought that ‘the fact that the application had been made should be publicised and that the hearing(s) should be in public’.

However, he was persuaded by the executor of Prince Philip’s estate and then attorney general Michael Ellis QC that the hearing should be conducted in private, adding that  ‘only the attorney general can speak, as a matter of public law, to the public interest’.

McFarlane said ‘there was, legally, therefore no role for those who might represent the media at a hearing (public or private) in putting forward any contrary view of the public interest’.

In November, the Guardian announced that it was seeking permission to appeal against the decision on the basis that the decision represented a ‘serious interference with the principle of open justice’. The newspaper was granted permission by Lady Justice King this week.

She said that the argument that McFarlane ‘erred in law in denying the media an opportunity to make submissions, or at least to attend and hear submissions, as to whether the substantive application … should be heard in private’ had a real prospect of success.

King also granted permission to appeal on two other grounds relating to whether the decision to hear the application in private ‘was itself wrong’ and whether the High Court erred by finding that the attorney general was ‘the only person who is recognised by public law as being entitled to represent public interest in a court of justice’.

McFarlane’s initial ruling revealed that he is the custodian of a safe containing the wills of more than 30 deceased members of the royal family. A list of the wills currently held in the custody of the president of the family division was published in November.