Where a person not entitled to do so acts in an office to which this section applies, the High Court may—
grant an injunction restraining him from so acting; and
if the case so requires, declare the office to be vacant.
This section applies to any substantive office of a public nature and permanent character which is held under the Crown or which has been created by any statutory provision or royal charter.