It may be issued by any court, except district or municipal courts, to an inferior tribunal, or to a corporation, board or person, in all cases where there is not a plain, speedy and adequate remedy in the ordinary course of law. It is issued upon affidavit, on the application of the person beneficially interested.