The issue is whether the Albany County Court acted in excess of its authority in granting the defendant in the related criminal action then pending before it an inspection of the Grand Jury minutes, and whether the remedy of prohibition lies to correct such excess.
It is well settled and not disputed on this appeal that prohibition may be used “ ‘ to restrain an inferior court from exceeding its authorized powers in a proceeding over which it has jurisdiction ’ ” (e.g., Matter of Lee v. County Ct. of Erie County, 27 N Y 2d 432, 436-437; Matter of Hogan v. Court of Gen. Sessions, 296 N. Y. 1, 8; People ex rel. Lemon v. Supreme Ct., 245 N. Y. 24, 35). In this court’s most recent elaboration of the applicable principles it was said: ‘ ‘ Although the use of the writ of prohibition has usually been limited to cases where a court acts without jurisdiction [citing cases], it is equally clear that ‘ function of the writ * * * [is] not merely to restrain an unwarranted assumption of jurisdiction, but also to restrain an inferior court from exceeding its authorized powers in a proceeding over which it has jurisdiction. ’ [citing cases] ” (Matter of Lee v. County Ct. of Erie County, supra, pp. 436-437). In that same case with parallel relevancy to the present issue it was said: “In the instant case, the order striking the plea was clearly nonappealable to the Appellate Division; thus, if prohibition were not available to Lee, he would be forced to submit to trial without the benefit of his plea ” (id., p. 437).
Leo Demeris was indicted, by the 1970 term of the Albany County Grand Jury, for grand larceny and offering a false instrument (Penal Law, §§ 155.35, 175.35). The charges arose out of a criminal investigation into municipal snow removal *19costs during the winter of 1969-1970 in the City of Albany. Shortly after the indictments were handed up, Demeris moved for inspection of the Grand Jury minutes to enable him to move for dismissal of the indictments on the grounds of insufficiency and improper conduct on the part of the District Attorney. The County Judge granted inspection, expressly stating that it was not necessary to discuss the grounds urged by Demeris. He inspected the minutes in camera but did not suggest that there was any doubt as to the sufficiency of the evidence to support the charges. He said Demeris would need the minutes to provide the information for the preparation of his defense. He also stated he was granting the motion in the interests of justice.
To be sure, the County Judge, later in this proceeding on his return to the petition, amplified in an affidavit on his reasons for granting the extraordinary broad discovery allowed, but these after-developed reasons were not the grounds originally assigned for his determination. In any event, even the added grounds do not support the unlimited inspection granted. Inspection was not limited to the pages or sections relating to the Demeris indictments. The entire 867 pages of Grand Jury testimony involving eight defendants and 16 indictments were disclosed.
The cloak of secrecy accorded Grand Jury proceedings for the protection of the public, witnesses, potential defendants, and others may not be lifted for purposes of general unilateral discovery before a criminal trial (People v. Howell, 3 N Y 2d 672, 675; People ex rel. Lemon v. Supreme Ct., supra, at p. 31; Matter of Montgomery, 126 App. Div. 72, 82; Ann., Inspection — State Grand Jury Minutes, 20 ALB 3d 7, 59). Absent reason to believe that the evidence before the Grand Jury is insufficient or illegal, the court lacks authority because it lacks grounds to permit inspection (id.). Even the pretext of authority is absent where the right of inspection is extended to unrelated testimony, as was done here.
The limitation on the power to grant inspection has been codified in section 210.30 (subd. 2) of the Criminal Procedure LawA motion to inspect grand jury minutes is a motion by a defendant requesting the court to examine the stenographic minutes of a grand jury proceeding resulting in an indictment *20for the purpose of determining whether the evidence before the grand jury was legally sufficient to support the charges or a charge contained in such indictment. Such motion must be in writing and the moving papers must allege that there is reasonable cause to believe that the grand jury evidence was-not legally sufficient to support a specified count or counts of the indictment, and must contain sworn allegations of fact supporting such claim. Such allegations of fact may be based either upon personal knowledge of the affiant or affiants or upon information and belief, provided that in the latter event the sources of such information and the grounds of such belief must be stated.” It is no answer to argue that the Grand Jury minutes are in the control of the trial court. It is the authority to turn the minutes over to the defendant for general discovery which is lacking.
Similarly, it is no answer to argue that if the motion court had granted limited inspection for the purpose of determining the sufficiency of the indictment, there would have been at most an abuse of discretion. The motion court has power to do for some purposes what it lacks power to do for others. Moreover, although prohibition has not been applied in this precise situation, it has been suggested that it might be available upon a showing of abuse of discretion in granting the nonappealable order of inspection (Matter of Schneider v. Aulisi, 307 N. Y. 376, 383; but, see People exrel. Cohn v. County Ct. of Schenectady County, 11 A D 2d 438, 441).
In this analysis it is not relevant to worry over whether the papers submitted by defendant on the motion in the criminal action were sufficient or not to establish illegal oppression by the prosecutor in the presentation to the Grand Jury, and correspondingly whether the prosecutor is to be faulted for not answering fully averments on hearsay information improperly made without giving the source of the information. On any view the issues on the sufficiency of the papers or the denials would involve at most errors of law for which, to be sure, prohibition would not lie. The gravamen of this proceeding is the unwarranted disclosure solely for purposes of discovery of an entire Grand Jury investigation into municipal corruption involving persons, transactions, and crimes not related or *21attributed to the charged defendant. The disclosure would be unwarranted even if that defendant had submitted proper papers on his motion, and would not be made the less unwarranted because the prosecutor failed to answer allegations he was not bound to answer. This analysis applies so long as it is true, and it is not contradicted that it is true, that under present law the inspection before trial of Grand Jury minutes is available only as an ancillary remedy to a motion to dismiss the indictment for insufficiency.
The nub of the matter is that the inspection of Grand Jury minutes in advance of trial is available only to attack the indictment, and may not be allowed only to assist the litigant in the trial which may ensue. To violate this principle by nonappealable order is to act without power, however categorized, and involves more than an error of law correctible on appeal in some later phase of the proceeding.
Accordingly, the judgment of the Appellate Division should be affirmed.