delivered the - opinion of the court:
Plaintiffs in error, defendants below, were respectively, as designated in the title, water commissioner of tbe seventh water district, superintendent of irrigation for water division No. 1, and state engineer. Water district No-. 7 consists of lands irrigated from Clear creek and its tributaries. Water division No. 1 embraces lands irrigated from the South Platte river, other streams and their tributaries.
In May, 1902, the superintendent of division No.' 1 directed the commissioner of water district No. 7 *186to close down the headgates of all ditches in his district of later priority than October 5, 1871, until further notice, in order that the Evans ditch, in water district No. 2, might obtain water to supply its priority, dated October 5, 1871. Water district No. 2 embraces the territory irrigated from the South Platte river and its tributaries, except Clear creek, the Big Thompson and St. Vrain rivers below the mouth of Clear creek and the mouth of Cherry creek. Defendants in error, plaintiffs below, shortly after the order above referred to, filed a complaint in the district court upon which they asked and obtained an ex parte injunction against the defendants, plaintiffs in error here, restraining them from interfering with or preventing the plaintiffs from taking or receiving through the headgates of their respective ditches water to which they were entitled as decreed to them, and to which they were entitled according to the averments of their complaint, or from in any manner interfering or meddling with the headgates’ of plaintiffs’ ditches, or preventing plaintiffs from raising such headgates and permitting the water to which, they were entitled to flow into their ditches. This injunction was issued by order of the judge of the county court, it being alleged that the judge of the district court was absent from the county.
The respective pleadings of the parties are lengthy, but the following synopsis will sufficiently present the issues between them upon which they went to trial. According to their amended complaint, it appears that plaintiffs based their right to the relief demanded upon the ground that they owned certain adjudicated priorities to the use of water from Olear creek; that they had acquired the right to' the use of 400 cubic feet of the flood waters of that stream; that they, their shareholders and consumers, *187liad acquired a right to the use of water from Clear creek to the extent of their appropriations and acquisitions in such circumstances as to establish their right thereto by virtue of the statute of limitations ; that in May, 1902, -defendants threatened to cut off the supply to which they were entitled in order to supply consumers in district No. 2, and on the next day carried this threat into execution; that the defendants had illegally and unlawfully deprived them of the use of the water to which they were entitled; that they had present need therefor; that their rights thereto were superior to the appropriations in district No. 2; that the water of which they were deprived would not reach consumers in district No. 2, because it was lost by seepage and evaporation in flowing down the river; that consumers, though junior to plaintiffs in right, were permitted by defendants to take water from the Platte river and Clear creek in quantities which would supply the needs of consumers in district No. 2.
It is finally charged that the danger is too imminent, and the damage which the plaintiffs will suffer will be irreparable, if they should be required to await the length of time which would be necessary to give the defendants the required notice of an application for a temporary writ of injunction. The prayer of the complaint is to the effect that a temporary writ of injunction issue, restraining the defendants and their successors in office from interfering with," or in any manner preventing the plaintiffs from, taking or receiving through their several head-gates, the water from Clear creek to which they were entitled according to the averments of their complaint; and that they, the defendants, be further restrained from in any manner meddling or interfering with, or shutting down the headgates of plaintiffs’ ditches, or preventing the plaintiffs from rais*188ing their headgates and permitting the flow of water into their ditches to which they claim to be entitled, and that upon final hearing such injunction be made perpetual.
By their answer the defendants denied that plaintiffs had acquired any right to the use of flood waters of Clear creek; denied that they had acquired any rights by virtue of adverse user; denied that ditches junior to those of plaintiffs were permitted to take water from either the river or Clear creek; set out in detail the dates and priorities of ditches as established by statutory proceedings, from which it appears that the priorities of The Farmers’ High Line Canal and Reservoir Company antedated October 5, 1871; denied that the priorities of The Agricultural Ditch Company were. subsequent to that date; that some of the priorities of The Rocky Mountain Ditch Company antedated October 5; 1871, and others were of later date, and that a great number of ditches in district No. 2 had priorities of date prior to October 5, 1871; that in order to supply the priorities in district No. 2, antedating this date, it was necessary to order the headgates of plaintiffs’ ditches to be closed as to priorities junior to that date, and that the order of which plaintiffs complain was made for this purpose. They also challenged the sufficiency of the complaint by general demurrer.
Subsequent to filing this answer, defendants moved to dissolve the temporary injunction, with the result that it was modified so as to permit the superintendent to distribute the waters in division No. 1 in accordance with the decrees in the several districts in that division, provided there should be retained in district No. 7 water to the amount of 180 cubic feet in addition to the decreed priorities in that district, which excess water was to be prorated among *189the several ditches therein according to their priorities.
The reply filed by plaintiffs to the answer of defendants was little more than a reiteration of some of the averments of the complaint, except it might be said they averred that the priorities of the ditches mentioned by defendants in their answer had been lost in 'a great measure by abandonment..
From the bill of exceptions it appears that the only question upon which testimony was admitted was, whether the defendant Armstrong, as superintendent of irrigation, had properly and lawfully issued the orders set out in his answer, for the purpose of furnishing water to supply the priorities in division No. 1, and whether he had sufficient data upon which to issue such orders and had taken the steps necessary to authorize him to issue them, and whether they were, under the circumstances, authority for the water commissioner in district No. 7 to. adjust the headgates of plaintiffs ’ ditches, in accordance therewith.
The trial court seems to have found as a fact that the superintendent had not performed his duties or complied with the law in this respect, and from this finding deduced the conclusion that the water officials were without jurisdiction to act in the prem-° ises, in issuing the orders to close the headgates of plaintiffs’ ditches. The trial court expressly held that under the issues made by the pleadings, no testimony would be admitted in any way impeaching the priorities as adjudicated in the various districts, nor touching the acquisition of any additional water rights by virtue of the use by appropriation of flood waters, or by long continued or uninterrupted use, for the reason that to enter into a consideration of such questions would necessitate a questioning of the *190rights of parties owning priorities in water divison No. 1, who were not parties to the action.
The judgment of the court was to the effect that until the water officials acquired jurisdiction or authority to act by collecting data with respect to the flow of water in the Platte river from reports and. personal investigation, from which it would be made to appear that it was necessary to close down the headgates of plaintiffs’ ditches, in order to supply priorities in district No. 2, that the injunction issued as modified should continue in force, except the order retaining 180 feet of the waters of Clear creek in district No. 2, which was dissolved and set aside.
The principal question urged for consideration by counsel for the defendant water officials is, that the complaint is fatally defective in that it does not state facts sufficient to constitute a cause of action against these officials, and that there is a lack of indispensable parties. The purpose of the action instituted by plaintiffs was to secure an injunction against the water officials, preventing them from closing down the headgates of their ditches, or preventing the plaintiffs from raising them, and permitting the water to which they claimed to be entitled to flow into and through their ditche's. In support of their right to this relief, after alleging their respective rights to the use of the waters of Clear creek, they state, in substance, that in May, 1902, the defendants threatened to cut off the supply to which they were entitled, and run a large amount of water down the stream past their headgates and into the river for the use of ditches in water district No. 2, which took their supply^ of water from the river, and that on the next day they carried this' threat into execution.
By section 2448, 1 Mills’ Statutes, it is made the *191duty of the superintendent of irrigation to distribute the waters in his division in accordance with the rights of priority of appropriation as established by the judicial decrees entered in the several water districts included in such division, and that he shall have general control over the water commissioners of the districts embraced in his division. The several decrees of the water districts within a water division are to be treated as one, and the water distributed accordingly. It is the duty of the superintendent of a water division to make such distribution by direction to the water commissioners under his control.—Lower Latham D. Co. v. Louden I. C. Co., 27 Colo. 267. The law presumes that public officials discharge their duties in conformity with the statutes, and the burden of showing to the contrary rests with him who relies thereon.—Catron v. Co. Commissioners, 18 Colo. 553; Root v. Evergreen Cemetery Co., ibid. 132.
It appearing*, then, from the averments of the complaint that the acts of the defendants of which plaintiffs complain were committed by them for the purpose of supplying ditches with water in district No. 2, the presumption attaches that they ordered the headgates of plaintiffs’ ditches to be closed so as to supply senior priorities further down the stream; so that the averments of the complaint to which we have referred do not state any facts from which it is made to appear that the acts of the water officials which the plaintiffs sought to enjoin were not necessary in the discharge of their official duties. It is charged, however, that the acts of the defendants -in. closing down plaintiffs’ headgates were wholly unauthorized, illegal and unlawful, and a wrongful and malicious interference with the rights of plaintiffs and their consumers and stockholders, for the reason that thereby they are prevented from *192receiving or obtaining water from Clear creek. This statement does not aid the complaint, because it is but a statement of a mere legal conclusion without any statement of facts upon which to base it. Allegations of legal conclusions do not aid a complaint.—Downing v. Agricultural D. Co., 20 Colo. 546.
Where illegality of official action is relied upon as a ground for invoking the aid of a court to restrain steps to be taken in consummation thereof, the party seeking such relief must allege' the facts which constitute the illegality complained of.—17 Enc. Pl. & Pr. 189; Talcott v. City of Buffalo, 125 N. Y. 280; Palmer v. Logansport & Rock Creek G. R. Co., 108 Ind. 137.
Plaintiffs averred that their rights to the use of water represented by their priorities and rights which they had ■ acquired to the waters of Clear creek, were superior to those of appropriators of water in district No. 2, and that there were other appropriators. then drawing .water from the river and Clear creek junior to the rights of plaintiffs sufficient to supply the needs of consumers in that district. The defendants were not claiming the water for their use. They had no’ personal interest therein. Their action in taking the necessary steps to cause the water of Clear creek to flow down the stream for the use of appropriators below was in the discharge of their duties. They were but the agents to distribute the water in accordance with the several decrees adjudicating water rights in water division No. 1. They could hot represent the consumers in district No. 2; so that any determination of the question of the relative rights of plaintiffs and other consumers in division No. 1 would not bind the latter.—Squire v. Livezey, 36 Colo. 302.
In short, none of the averments of the complaint to which we have referred, nor all taken together, *193state any canse of action againt the defendant water officials, for the reason that it appears that they were only acting in their official capacity, and no facts are pleaded from which it is made to appear that they were acting in excess of the authority conferred upon them by law. True, as just noticed, plaintiffs averred that their rights were superior to appropriators of water in district No. 2, but this averment merely emphasized the fact that the real parties in interest were the appropriators in that district.
This brings us to a consideration of the question of the lack of indispensable parties defendant. At the commencement of the trial, counsel for defendants objected to the introduction of any testimony, for the reason that it appeared from the pleadings that the owners of water rights in district No. 2, for whose benefit the plaintiffs’ headgates were closed, were not made parties defendant, and that the court for this reason could not enter any decree granting plaintiffs the right to the use of the water of Clear creek, of which they had been deprived, without the presence of the consumers in district No. 2, for whose benefit the water officials had ordered the waters of Clear creek run down past plaintiffs’ headgates. It is suggested by counsel for plaintiffs that the question of a defect of parties was waived by the defendants in joining issue and going to trial. The rule invoked, is not.applicable where the court cannot proceed to judgment without the presence of others who are not parties to the proceedings.—Denison, Admr., v. Jerome, 43 Colo. 456. Our Civil Code, §16, provides :
“The court may determine any controversy between the- parties before it when it can be done without prejudice to the rights of others or by saving their rights; but when a complete determination of the controversy cannot be had without the presence *194of other parties, the” court shall order them to be brought in. ’ ’
Under this provision the court should not have attempted to- try any issue made by the pleadings -without the presence of the consumers in district No. 2, for whose benefit the order of the officials of •which plaintiffs complain was made. There could bé no complete determination of the controversy without their presence. The relief demanded by the complaint could not be granted against the water officials without prejudice to the rights of these consumers ; neither could their rights be saved in their absence, for the obvious reason that they were the parties who would be directly affected by the judgment demanded, the effect of which would be to determine their rights to the waters of Clear creek as against the plaintiffs in an action wherein they were not heard. Necessary parties are all who have an interest in the subject and object of the action, and all persons against whom relief must be obtained in order to accomplish the object of the suit.—McArthur v. Scott, 113 U. S. 340; Williams v. Bankhead, 19 Wall. 563; Note, § 20, Bliss’ Code Pleadings (3rd ed); 15 Enc. Pl. & Pr. 611.
The water officials were but nominally interested. The object of the action was to prevent these officers from causing water to flow down the stream for the use of appropriators in district No. 2, and in order to effect this end it was necessary that the rights of plaintiffs to the subject-matter of controversy be adjudged superior to those of these appropriators. The consumers in water district No. 2 were, therefore, indispensable parties to the action.—Farmers’ High Line C. & R. Co. v. White, 32 Colo. 114; Brown v. Farmers’ High Line C. & R. Co., 26 Colo. 66.
*195The trial judge realized that the presence of these consumers was necessary, but sought to avoid rendering a judgment which would affect their rights by basing his decision upon the ground that the water officials were without jurisdiction to order the headgates of plaintiffs’ ditches closed, because they had not taken the necessary preliminary steps to secure data relative to the flow of water in the river and its tributaries. This did not relieve the situation. The order was made for the benefit of consumers in district No. .2, and any judgment which prevented this order from being carried into effect deprived them of the use of water without affording them an opportunity to be heard. It is doubtless true that water officials must distribute the waters of a district or division according to adjudicated priorities, but when they are avowedly attempting to do so, as' it is-made to appear from the pleadings in this case, their action cannot be interfered with either by interlocutory order or final judgment unless the real parties in interest are parties to the action.—Squire v. Livesey, supra.
Error in issuing the preliminary injunction ex parte and refusal to dissolve it, as well as in the order of the court modifying it, is assigned by counsel for the defendants. Ordinarily it would not be necessary to consider these contentions, but the ease at bar presents such an abuse of the use of the writ of injunction that these questions will be considered. It is such abuse of the writ which prompts protests against its use and requests for legislation to regulate its issuance. The writ of injunction is .the strong arm of the court, and to render its operation benign and useful, the power to issue it should be exercised with great discretion, and when necessity requires it. The purpose of the preliminary writ is to preserve the status quo or protect rights pend*196ing the final determination of á cause. The rules of law are well settled.when it should or should not issue, and if courts vested with authority to issue it will hut observe and apply these rules, the rights of parties will be more fully protected than they could be by any legislative enactments on the subject.
A court vested with power to issue injunctions should not hesitate to issue one ex parte upon a proper showing and in a proper case; but cafe should be exercised in so doing, lest those against whom the writ issues, or who are affected thereby, are irreparably injured, instead of the applicant for the writ if it is refused. The provisions of the code permitting ex parte injunctions to issue are intended to protect the applicant against loss or injury when it appears that an ex parte order is necessary for that purpose, but the showing in support of all such applications should be clear, flights to the use of water for the purposes of irrigation are of that supreme importance to all entitled to take water from a common source of supply that a court to which an application is made for an interlocutory writ affecting such rights should exercise great care in granting it ex parte.
It was long since deemed necessary by the legislature to provide a system of procedure by which the rights to the use of w-ater for agricultural purposes could be authoritatively settled. In the light of experience, perhaps that system could be improved; but considering the fact that it was enacted without the benefit of experience as a guide in formulating its provisions, it has proved to be reasonably satisfactory and practicable. With priorities settled it became necessary to appoint officials whose duty it is to distribute the waters of a stream according to the decreed priorities therein. Their functions and authority cannot be interfered with without ignoring *197adjudication decrees, and the statutes relating to the distribution of water thereunder, which would bring about the conditions that existed prior to the time when we had any statutes on the subject relating to the adjudication-of rights to the use of water or its distribution by officials in accordance with such adjudication. The laws of the state providing for officials to distribute the waters of our streams for agricultural uses according to adjudicated priorities were passed for the purpose of securing an orderly distribution of such waters, and to prevent breaches of the peace which would inevitably ensue if the owners of priorities were permitted to divert and divide the waters of our streams according to their ideas of their adjudicated rights and needs. These laws must be strictly enforced and observed, and the courts have no power to annul them.
There is another matter to which attention may well be directed. The code provides that in the absence of the district judge from any county of his district, then the county judge of such county, in causes, of action arising therein, may grant a writ of injunction. That was a provision which it was intended might he taken advantage of in order to protect rights when that course was necessary, but without definitely determining the question or the conditions under which the writ may. be ordered issued by a county judge, it certainly will be best for all concerned to not invoke the authority of a county judge to order an injunction to issue out of the district court of his county except in those cases where the delay in reaching the judge of the district court would work irreparable injury. With the present means of transportation and communication between the-different counties of a district, such an emergency cannot often arise.
It is contended by counsel for defendants that *198the preliminary writ ordered by the county judge was of a mandatory character in that its effect was to take water from the consumers in district No. 2 and give it to plaintiffs, and for this reason it is urged that the order was erroneous, because the law prohibits the issuance of a writ of injunction out of the district court upon the order of either the county judge or county court which shall attempt to give mandatory relief. — Section 1057, 1 Mills’ Statutes. This is an important question, which it is not necessary to determine, because it is apparent that the writ was improvidently issued in the first instance, and that it should have been dissolved when application by defendants for that purpose was made to the district court. The effect of the preliminary injunction was to suspend the decrees adjudicating water rights in district No. 7. It suspended the functions of the water officials in this district so far as plaintiffs were concerned. As modified, the water officials were directed to retain 180 cubic feet in No. 7, to be prorated between the consumers of water in that district over and above their adjudicated priorities by which they were given the right to th’e use of water which had- never been established by any adjudication proceedings. The defendant officials in the first instance were enjoined from in any manner interfering with the headgates of plaintiffs’ ditches, so that plaintiffs were permitted to take the waters of Clear creek according to their own ideas of what they were entitled to from this stream, without regard to the rights of others therein. Such an order had the effect of suspending the authority and functions of the water officials, and ignored the rights of Others to such an extent that it needs no argument to demonstrate that it was clearly error, and that the writ of injunction issued in accordance therewith was improvidently granted. The bond which the plain*199tiffs were required to give in this ease ran to the water officials.. They were not damaged by the non-use of the water, the control of which they were entitled to exercise under the statutes, but which was wrested from them. The real parties injured were the consumers of water in district No. 2, for whose benefit the water officials had ordered the headgates of plaintiffs’ ditches closed down; and yet they were not protected by any obligation which the plaintiffs were required to give as a condition precedent to the issuance of the writ which they secured.
Whether or not plaintiffs had just cause of complaint against the water officials because there were other priorities in the river junior to theirs which should have been called upon to supply the demands of consumers in district No. 2, or whether the priorities in that district which the officials had ordered supplied by closing down the headgates of plaintiffs’ ditches, were junior to plaintiffs ’ rights, were immaterial, because these questions could not be determined in the absence of those for whose benefit the order was made of which plaintiffs complain; so that a case was permitted to be instituted- and a preliminary injunction issued therein which directly affected the rights of the consumers in water district No. 2, although they were not parties to the action. The trial court realized -that these consumers should be parties; but, as we have previously pointed out, the effect of the judgment rendered upon the issue which he tried and determined was to deprive the consumers in district No. 2 of the benefit of the order by the water officials which, by virtue of the preliminary writ and the final judgment, these officials were prevented from executing.
Counsel for plaintiffs contend that the act for the distribution of waters passed by the general assembly-of 1887 — Session Laws of that year 295 — is *200unconstitutional. That question was • long since •settled to the contrary in Farmers’ Independent Ditch Co. v. Agricultural Ditch Co., 22 Colo. 513.
The judgment of the district court is reversed and the cause remanded, with directions to dissolve the injunctive orders therein, and to dismiss the case at the cost of plaintiffs. Judgment reversed.
Chiee Justice Steele and Mr. Justice Camp-' bell concur. _