Under chapter 551 of the Laws of 1909, which established the bureau of buildings of the city of Albany, it is provided that a permit must be obtained from the superintendent of buildings before work may be commenced on the erection of structures within the city. Completed plans must be submitted to the bureau of buildings and approved by the superintendent before such permit is issued. The superintendent may grant a temporary-permit for the erection of any part of a structure where plans have been presented for that portion of the same before the entire plans have been submitted. Chapter 221 of the Laws of 1921, which amends sections 7 and 8 of chapter 551 of the Laws of 1909, gives a right of appeal from the rejection or refusal of the superintendent to approve such plans and establishes a board of appeals with jurisdiction to hear such appeal and to “ make such order as in its opinion ought to be made in the premises, and to that end it shall have all the powers of the superintendent of buildings.” A city ordinance passed June 3, 1929, regulates the construction and installation of tanks for the handling and storage of petrolemn and petroleum products within the city of Albany. It sets forth in detail the requirements for such tanks, including specifications for kinds and sizes of materials, type and manner of construction, capacity and location. Tanks of over 400,000 gallons storage capacity must be erected at a minimum distance of 175 feet from the adjoining property fine.
The respondent owns twenty-six acres of land in the southern part of the city of Albany upon which are erected seven tanks for the storage of petroleum products. On August 21,1934, it filed with the superintendent of buildings of the city of Albany an application for the erection of six new tanks for the storage of gasoline and other petroleum products ranging from 1,579,200 to 2,310,000 gallons in capacity, with a total capacity of more than 10,000,000 gallons and increasing the storage capacity of the entire plant to about 14,000,000 gallons. On October 4, 1934, the superintendent issued a temporary permit to work pending the filing of plans and specifications which were filed two days later. It is undisputed *461that these plans showed non-compliance with the minimum distance requirements of the ordinance. This temporary permit was on October 17, 1935, canceled by the superintendent on account of the extreme fire hazard involved and he forbade further prosecution of the work.
Under the statutory provisions relating thereto the respondent appealed to the board of appeals from the action of the superintendent. Hearings were held and testimony taken before this board and on March 6, 1935, the board sustained the superintendent of buildings in his revocation of the temporary permit and refusal to grant a final permit, assigning as a reason the extreme fire hazard attending the construction and use of the storage tanks applied for.
Application was then made to the Supreme Court at Special Term for a peremptory order of mandamus. This application was granted and the order of the court below commanded the superintendent of buildings to forthwith issue a rescission of his cancellation or revocation of the temporary permit and to issue a permit for the erection of the additions and improvements on respondent’s property shown on the plans and drawings filed by it with him “ on its filing with him plans and drawings in compliance with the provisions of the Ordinance of the City of Albany passed by the Common Council thereof June 3,1929, with respect to the minimum distance measurements specified in section 8 thereof.” The case comes to us on an appeal from this order.
A peremptory order of mandamus may be granted only to enforce a clear legal right. The mandamus issues to compel the performance of official duty clearly imposed by law, where there is no other adequate specific remedy. The duty must be positive, not discretionary, and the right to its performance must be so clear as not to admit of reasonable doubt or controversy. (Matter of Burr v. Voorhis, 229 N. Y. 382.) A peremptory order of mandamus may not be indefinite. It may not leave a wide discretion as to that which is ordered to be performed. Its function is to compel the doing of a specific thing based upon a legal right. (People ex rel. Delaney v. Interborough Rapid Transit Co., 192 App. Div. 450.) Concededly in the instant case the plans of respondent did not comply with the minimum distance requirements of the city ordinance for petroleum products storage tanks of the capacity here involved. Consequently the respondent was not entitled to a permit for the erection of these tanks. The court below recognized this fact for its very order was conditioned upon the respondent’s filing a new set of plans complying with the provisions of the ordinance with respect to the minimum distance measurements. It appears upon the face of the order itself that there yet remained to be done by respondent the *462filing of plans which would comply with the ordinance. The order directs the appellants to approve plans not on file. Such plans, when filed, may fail to comply with the building code or ordinances in respects other than the minimum distance requirements. The condition contained in the order negatives respondent’s right to the order. The respondent did not have a clear legal right to the relief granted. “ The office of a mandamus is not to compel action by the building department in advance of the preparation and adoption of proper plans, but only to compel action when plans affording no legitimate ground of objection have been arbitrarily or unreasonably condemned.” (Matter of Hartman v. Collins, 106 App. Div. 11.)
It is argued that the only reason assigned by the superintendent of buildings and the board of appeals for the revocation of the temporary permit and the refusal of the permanent permit was the extreme fire hazard and that no mention was made of the failure to comply with the minimum distance requirements. Even so, this did not give the respondent the right to a permit. The result was correct although the reason assigned was erroneous. Respondent also claims a vested right under the temporary permit. A permit granted in violation of the ordinance vested no rights in the respondent. (Rollins v. Armstrong, 226 App. Div. 687, 752; affd., 251 N. Y. 349.)
For the reasons before assigned the order below must be reversed and the application denied. We do not pass upon other questions raised such as the sufficiency of the reasons given by the superintendent of buildings and the board of appeals for their determinations and the constitutionality of the ordinance of December 1, 1930, referred to in the opinion below. As the situation stands in this case, the respondent had filed plans which showed a non-compliance with the city ordinance. It was not entitled to the issuance of any permit and the learned Special Term could not grant a conditional peremptory order of mandamus.
The order should be reversed and the petition dismissed, with fifty dollars costs and disbursements.
Rhodes and Crapser, JJ., concur; Hill, P. J., dissents, with an opinion, in which Heffernan, J., concurs.