
179 N.W.2d 767 (1970)
Mahlon HEADID, Appellant,
v.
Mark R. RODMAN, individually, and as Building Inspector of the City of Sioux City, Iowa, William Hogan, individually, and as Plumbing Inspector of the City of Sioux City, Iowa, and the City of Sioux City, Iowa, Appellees.
No. 54067.
Supreme Court of Iowa.
September 24, 1970.
*768 O'Brien & Galvin, Donald E. O'Brien, Sioux City, for appellant.
Robert C. Clem, Sioux City, for appellees.
STUART, Justice.
Plaintiff brought this action in equity seeking a writ of mandamus directing the City of Sioux City through its appropriate officials to issue a permit to disconnect the home of a third party from his private stub sewer line. The trial court refused to order the writ on three grounds. (1) The ordinance under which the writ was sought did not call for a ministerial act but gave discretion to the officials who had not acted arbitrarily or capriciously in refusing to issue the permit. (2) The rights of a third party, not a party to the lawsuit, would be adversely affected. (3) The third party had acquired an easement over plaintiff's premises for the use of the sewer. It also questioned whether plaintiff came into equity with clean hands, but did not decide the case on this ground. Plaintiff appealed from the judgment entered.
In the early 1920's Harriett L. Foster owned lots four and five in block 23, Morningside Addition to Sioux City. A store building (5308 Morningside Avenue) was located on lot five. A house (5308½ Morningside Avenue was located behind the store building and extended a short distance onto lot four. Mrs. Foster built another home (5306 Morningside Avenue) on lot four and connected the sewer and water to the lines serving 5308 and 5308½.
Plaintiff purchased 5308 and 5308½ from Mrs. Foster in 1946. The record does not show when Mrs. Foster sold 5306 or when the present owners acquired title.
According to plaintiff, in about 1967 the city at the instigation of the owner of 5306 *769 shut off his water supply from the common pipe and compelled him to put in a separate connection with the water main located across Morningside Avenue which ran in front of these lots. Plaintiff then hired a plumber to disconnect the sewer line from 5306 from the sewer line on his property without obtaining a permit to do so.
The city officials issued a permit for the owner of 5306 to lay a sewer line on his own property to the parking and to connect with the sewer line serving 5308 and 5308½ on the city property rather than requiring him to cross Morningside Avenue and make a separate connection with the sewer main. There was evidence it would have cost $2000 to cut through the paved portion of the 80 foot street to lay the sewer line.
Plaintiff then applied for a permit to disconnect this line from the line coming from his property. Permission was refused on three separate occasions. This action in mandamus resulted.
I. Mandamus is the proper remedy to compel the performance of a ministerial act. Section 661.1, Code of Iowa; Independent School District of Danbury v. Christiansen (1951), 242 Iowa 963, 969, 49 N.W.2d 263, 267.
If the tribunal or person has discretion in the matter, mandamus can compel it to act but cannot control such discretion. Section 661.2, Code of Iowa; Hougen v. George (1963), 254 Iowa 1055, 1057-1058, 120 N.W.2d 497, 498; Iowa Mutual Tornado Ins. Ass'n. v. Timmons (1960), 252 Iowa 163, 169, 105 N.W.2d 209, 212; Independent School District of Danbury v. Christiansen, supra.
However, if the tribunal or person acts arbitrarily and capriciously, mandamus will issue to correct such abuse of its discretion. Gibson v. Winterset Community School District (1966), 258 Iowa 440, 444-445, 138 N.W.2d 112, 115.
A ministerial act is one which is to be performed upon a given state of facts, in a prescribed manner, in observance of the mandate of legal authority and does not require the person or board charged with the duty of performing the act to exercise his or its own judgment. Gibson v. Winterset Community School District, supra; Independent School District of Danbury v. Christiansen, supra; First National Bank of Remsen v. Hayes (1919), 186 Iowa 892, 902, 171 N.W. 715, 718.
("Discretion may be defined, when applied to public functionaries, as the power or right conferred upon them by law of acting officially under certain circumstances, according to the dictates of their own judgment and conscience, and not controlled by the judgment or conscience of others." First National Bank of Remsen v. Hayes, supra; approved, Independent School District of Danbury v. Christiansen, supra and citations.
II. Plaintiff claims the issuance of the permit is a mandatory ministerial duty the performance of which may be compelled by a writ of mandamus. He relies on section 92.3-2(1) of Sioux City's Plumbing Ordinance which provides:
"Every building intended for human habitation or occupancy on premises abutting a street * * * in which there is a public sewer within one hundred fifty (150) feet of such premises shall have a connection with such sewer and if possible, a separate connection." and section 92.2-2(6) which states: "If the word `shall' is used, the meaning is the act to be performed is mandatory."
These sections require all dwellings on premises within 150 feet of a public sewer to be connected to such sewer. The matter of a separate connection, which is the issue involved here, presents a different problem. The use of the phrase "and if possible" injects a judgment decision into the ordinance. The responsible public functionaries must decide whether it is "possible" for a particular property to have a *770 separate connection. As they exercise their own judgment in making the decision, the act of issuing a permit becomes discretionary.
Plaintiff calls our attention to the testimony of the plumbing inspector who denied the permit to plaintiff. He testified it was possible to connect 5306 into the public sewer across Morningside Avenue. If "possible" as used in this section means a separate connection is required in all instances where it is not physically impossible to make a separate connection, a serious question would be raised as to the arbitrary and capricious nature of the refusal of the permit. However, we believe the phrase "if possible" is intended as a synonym for practicable or feasible. It is difficult to conceive of a situation in which it would be possible to connect a property abutting a street with a public sewer by a joint line and be physically impossible to connect it separately. It seems more reasonable to interpret the phrase as permitting reasonable exceptions to the separate connection provision.
Under this construction of the ordinance, we cannot say the issuing authority abused its discretion in refusing to issue a permit to remove 5306 from the joint sewer line. The fact that these properties had used the same line for over forty years, the placing of the cost of constructing a separate line on a third party, the inconvenience of having a main street closed and the undesirability of having the pavement cut and the land under it excavated are all matters which may have entered into the practicability and feasibility of requiring a separate connection and could have influenced the decision to refuse the permit.
The city through its officials might well have required a separate connection under these circumstances. This does not mean, however, that plaintiff had the right to compel them to do so.
III. Even if we were to hold the ordinance required each property to have a separate sewer connection unless it was a physical impossibility and the issuing authority abused its discretion in refusing to issue the permit, it would not mean plaintiff was automatically entitled to a writ of mandamus.
"Mandamus is a summary and extraordinary writ issued in the sound discretion of the court. Owing to the drastic character of the writ, the law has properly erected safeguards around it, and regard should be had for the exigency which calls for the exercise of the discretion, the interests of the public and of third persons, the nature and extent of the wrong or injury which would follow upon refusal of the writ, and the promotion of substantial justice. The writ will not issue in doubtful cases, but only where the right involved and the duty sought to be enforced are clear and certain and where no other specific and adequate mode of relief is available to the complaining party. Likewise the writ will not be granted where it would serve no useful purpose or where it would work hardship or injustice or be detrimental to the public interests. Every proceeding in mandamus must be determined upon its own setting of facts and upon equitable considerations." 34 Am.Jur. 829, Mandamus, § 32. See: Baird v. Webster City (1964), 256 Iowa 1097, 1114, 130 N.W.2d 432, 442; State v. Ottumwa R. & L. Co. (1916), 178 Iowa 961, 968-969, 160 N.W. 336.
Plaintiff's right to the performance of the act he seeks to compel must be clear, certain and free from the possibility of any reasonable controversy. Claussen v. Perry (1956), 248 Iowa 108, 117, 79 N.W.2d 778, 783.
In State v. Ottumwa R. & L. Co., supra, we quote with apparent approval from People ex rel. v. Olsen, 215 Ill. 620, 74 N.E. 785:
"When a writ of mandamus is asked, the court may inquire whether it will operate impartially, create confusion and disorder, and whether it will or will not promote substantial justice. Courts, in the exercise of *771 the discretion with which they are vested, may, in view of the consequences attendant on the issuing of a writ of mandamus, refuse the writ, though the petitioner has a clear legal right for which mandamus is a proper remedy. (Citation) The court may act on existing facts, and view the case with references to the consequences of its action."
We view this action in mandamus as an attempt to resolve obliquely the real controversy between plaintiff and the owner of 5306. The ordinance upon which plaintiff relies was designed to give the city the power to require separate sewer connections. Apparently the city does not consider separate connections necessary at this time and place. There was no evidence the joint line was causing any one difficulty. Plaintiff testified as to plans to enlarge his buildings but there was no evidence what additional use would be occasioned thereby or that the existing line was not adequate to handle it.
If the court permitted plaintiff to disconnect the connection of 5306 to his sewer line, he would have achieved his desired result while avoiding a legal determination of the respective rights of the owners of the adjoining properties to use what has been a common sewer line. The owner of 5306 who was not a party to this action would as a result be burdened with a $2000 expense without ever having had his right to use the sewer determined. The fact that a third party might be injured if a writ of mandamus were issued is sufficient grounds for refusing to issue the writ.
"* * * [I]n the extreme caution with which this remedy is applied by the courts, there are cases when the writ will not be issued to compel the performance of even a purely ministerial act. * * *; or in a case where, the relator having another adequate remedy, the granting of the writ may in this summary proceeding affect the rights of persons who are not parties thereto, or where it will be attended with manifest hardship and difficulties. (Citations)" United States ex rel. Redfield v. Windom (1890), 137 U.S. 636, 644, 11 S.Ct. 197, 34 L.Ed. 811, 815, 200.
"In determining whether or not the writ of mandamus should issue, the court may consider not only defendant's rights but also the interest of third persons. Accordingly mandamus will not as a general rule issue where the rights of third persons not parties would be injuriously affected. Where questions of grave importance concerning rights of persons who have had no opportunity to be heard are involved in mandamus proceedings, the court, in the exercise of its sound judicial discretion, may refuse the writ, although it is an appropriate remedy." 55 C.J.S. Mandamus § 15, p. 40.
"It has been held that the writ will not issue if its issuance will injuriously affect the rights of a person not a party to the proceedings." 34 Am.Jur. 830, Mandamus, § 34. See also: United States ex rel. Crow v. Mitchell (1937), 67 App.D.C. 61, 89 F.2d 805, 809-910; Cooper v. Gibson (1933), 133 Cal.App. 532, 24 P.2d 952, 959; State ex rel. Davis v. State Highway Comm. of Missouri, 312 Mo. 230, 279 S.W. 689, 691; Beronio v. Pension Commission of City of Hoboken (1943), 130 N.J.L. 620, 33 A.2d 855, 858; In Re Savage (1941), 112 Vt. 89, 22 A.2d 153, 156.
We are aware of statements in Independent School District of Danbury v. Christiansen, supra, 242 Iowa at 972-973, 49 N.W.2d at 268-269, to the effect that an intervenor cannot change the position of the parties by broadening the scope of the mandatory action and that his rights can rise no higher than that of the original defendant. That is true in determining whether the act is ministerial or discretionary, but this does not affect the trial court's right to exercise its sound discretion in deciding whether or not the writ should issue under all the facts and circumstances involved.
For the reasons stated above, we believe the trial court acted well within its discretion in refusing to order a writ of mandamus in this case.
*772 IV. The trial court held 5306 had an implied easement over plaintiff's property to use the sewer line. This issue was not raised in the pleadings and was beyond the scope of the mandamus action. We do not decide this question. The trial court's decision on this issue is not binding on plaintiff.
The trial court is affirmed.
Affirmed. All Justices concur.
