
624 So.2d 1018 (1993)
Ex parte CITY OF BIRMINGHAM, et al.
(Re Mary P. CHAMBERS, et al. v. CITY OF BIRMINGHAM, et al.)
1920213.
Supreme Court of Alabama.
July 16, 1993.
Rehearing Denied August 20, 1993.
Demetrius C. Newton, City Atty., Joe R. Whatley, Jr., Michael K.K. Choy and Samuel *1019 H. Heldman of Cooper, Mitch, Crawford, Kuykendall & Whatley and John C. Falkenberry, Birmingham, for petitioners.
C. Jackson Perkins, Birmingham, for respondents.
PER CURIAM.
The defendants (the City of Birmingham and others) filed a notice of appeal from the trial court's order denying the defendants' motion to dismiss and compelling discovery. This Court has elected to treat that purported appeal as a petition for a writ of mandamus. We now grant the petition and issue a writ directing the trial court to dismiss the complaint.
On April 21, 1992, Mary P. Chambers and Samuel Bowdon, filed a complaint against the City of Birmingham; its mayor, Richard Arrington; the members of the Birmingham City Council (individually and as members of the council); Donald V. Watkins, an attorney; and fictitiously named defendants A, B, and C (other attorneys whose names and identities were then unknown, and who have not since been named, who had received what the plaintiffs considered unlawful and unreasonable attorney fees from the City of Birmingham). The action challenged the payment of attorney fees to Watkins, sought to enjoin the municipal defendants from paying private counsel, and sought to recover funds from counsel "unlawfully or unreasonably paid." It also sought repayment by Watkins of attorney fees paid to him. There was no allegation of fraud in connection with Watkins's retention or his compensation. Along with the complaint, the plaintiffs filed interrogatories and requested the City of Birmingham, the mayor, and the council members to produce documents. They also requested a description of each case and/or matter in which Watkins had been retained and the amount of money paid to him. The plaintiffs also filed a separate request for Watkins to produce documents.
On May 29, 1992, the municipal defendants filed a motion to dismiss; Watkins filed a motion to dismiss, and, in the alternative, moved for a more definite statement of the claims against him. The motions were based upon the defenses of absolute and qualified immunity of the municipal defendants and failure to state a claim against Watkins upon which relief can be granted. Attached to Watkins's motion was his 57-page affidavit describing his legal service to the city and listing 73 cases in which he was counsel of record. On June 9, 1992, all defendants filed objections to the plaintiffs' request for discovery on the grounds that the documents requested contained confidential information protected by the attorney-client privilege and the work-product doctrine.
The motions to dismiss were set for a hearing June 25, 1992. On the day before the hearing, the plaintiffs filed a motion to compel discovery. The trial judge held oral argument on the motions as scheduled. At the hearing, the parties agreed that the motion to compel was not before the court.
On October 22, 1992, the trial judge overruled the motions to dismiss, and, finding that the documents requested contained no privileged information, ordered the production of documents. On November 2, 1992, the defendants filed a motion seeking a reconsideration of the court's order compelling production, or, in the alternative, a protective order. A hearing was held the next day, at which all counsel agreed to a resolution of the discovery dispute. However, the trial judge refused to adopt the agreed resolution and ordered an in camera review of all documents. The defendants filed this petition for a writ of mandamus.
Mandamus is an extraordinary remedy requiring a showing of: "(1) a clear legal right in the petitioner to the order sought; (2) an imperative duty upon the respondent to perform, accompanied by a refusal to do so; (3) the lack of another adequate remedy; and (4) properly invoked jurisdiction of the court." Ex parte Edgar, 543 So.2d 682 (Ala.1989); Ex parte Alfab, Inc., 586 So.2d 889 (Ala. 1991).
The defendants argue that mandamus is appropriate in this case because, they contend (1) the City's elected officials are generally immune from suits and the plaintiffs have not pleaded facts that would remove their cloak of immunity; (2) this Court's decisions establish that immunity is properly *1020 raised by motion to dismiss, yet the trial judge has refused to grant the defendants' motions to dismiss; (3) mandamus is necessary because an appeal is not an adequate remedy to prevent undue hardship on the defendants; and (4) this Court's jurisdiction is properly invoked. We agree.
The standard of review applicable to motions to dismiss is set forth in Seals v. City of Columbia, 575 So.2d 1061, 1063 (Ala. 1991), quoting Fontenot v. Bramlett, 470 So.2d 669, 671 (Ala.1985):
"`It is well-established principle of law in this state that a complaint, like all other pleadings, should be liberally construed, Rule 8(f), Ala.R.Civ.P., and that a dismissal for failure to state a claim is properly granted only when it appears beyond a doubt that the plaintiff can prove no set of facts entitling him to relief. Winn-Dixie Montgomery, Inc. v. Henderson, 371 So.2d 899 (Ala.1979). Stated another way, if under a provable set of facts, upon any cognizable theory of law, a complaint states a claim upon which relief could be granted, the complaint should not be dismissed. Childs v. Mississippi Valley Title Insurance Co., 359 So.2d 1146 (Ala.1978).
"`Where a [Rule] 12(b)(6) motion has been granted and this Court is called upon to review the dismissal of the complaint, we must examine the allegations contained therein and construe them so as to resolve all doubts concerning the sufficiency of the complaint in favor of the plaintiff. First National Bank v. Gilbert Imported Hardwoods, Inc., 398 So.2d 258 (Ala.1981). In so doing, this Court does not consider whether the plaintiff will ultimately prevail, only whether he has stated a claim under which he may possibly prevail. Karagan v. City of Mobile, 420 So.2d 57 (Ala.1982).'"
(Emphasis in Fontenot.)
We have carefully examined the applicable law and the record in this case, and we conclude that the trial judge erred in denying the defendants' motions to dismiss. The plaintiffs have failed to allege, on the part of the named defendants, any violation of a municipal ordinance or a state statute or any violation under the common law, and they have not alleged fraud. The plaintiffs made a general complaint that in-house counsel should be handling the suits that private counsel have handled and that Watkins is being paid more than these plaintiffs believe to be appropriate. They have alleged that the municipal expenditures have been outside the realm of "good faith." However, for the following reasons, they have failed to state a claim upon which relief can be granted.
The only legal authority specified in the plaintiffs' complaint is Article IV, § 94, of the Constitution of Alabama of 1901, which the plaintiffs contend "prohibits the expenditure of municipal funds for individual or private purposes. Any expenditure by the City must be within the proper corporate interest, for the benefit of the City and this identified with a public purpose." They are correct that § 94 prohibits the grant of public funds for any individual purpose. Greenough v. Huffstutler, 443 So.2d 886 (Ala.1983). Section 94 provides:
"The legislature shall not have power to authorize any county, city, town, or other subdivision of this state to lend its credit, or to grant public money or thing of value in aid of, or to any individual, association, or corporation whatsoever, or to become a stockholder in any such corporation, association, or company, by issuing bonds or otherwise."
However, the plaintiffs have not alleged that the defendants have granted public funds for any individual purpose. Cities have the authority to retain attorneys when to do so is deemed advisable to protect the city or its officers. City of Birmingham v. Wilkinson, 239 Ala. 199, 194 So. 548 (1940); City of Montgomery v. Collins, 355 So.2d 1111 (Ala. 1978).
This Court has held that § 94 is not violated where compensation is exchanged for services and benefits rendered. Taxpayers & Citizens of the City of Foley v. City of Foley, 527 So.2d 1261, 1264-65 (Ala.1988). We adopted the trial court's finding in City of Foley that making compensation for services rendered did not constitute the lending of credit or the granting of public money or a thing of value in violation of § 94, since *1021 services and benefits were rendered in exchange for such compensation. Id. at 1264. This Court has also said that § 94 does not give a court the authority to determine whether a municipality received adequate consideration in a contract. The courts must "leave that determination to the judgment of the City's duly elected officials." Dothan Area Chamber of Commerce v. Shealy, 561 So.2d 515, 517 (Ala.1990).
City officials are absolutely immune from suits attacking their legislative judgment. Tutwiler Drug Co. v. City of Birmingham, 418 So.2d 102 (Ala.1982). The appropriation of funds by the city council is an exercise of legislative power. Morgan County Commission v. Powell, 292 Ala. 300, 305, 293 So.2d 830 (1974). City officials acting within the general scope of their authority have a qualified or discretionary immunity and are not subject to tort liability for an administrative act or omission. Taylor v. Shoemaker, 605 So.2d 828 (Ala.1992), adopting Restatement (Second) of Torts § 895D (1979). The Restatement provides that "A public officer acting within the general scope of his authority is not subject to tort liability for an administrative act or omission if ... he is immune because engaged in the exercise of a discretionary function." Thus, as a general rule, city officials are immune from suit unless they violate clearly established law. The plaintiffs do not allege any violation of law in this case.
Finally, it is a well-established principle of law that a court cannot substitute its judgment for that of a municipality, absent proof of unfair dealing, fraud, or bad faith. City of Birmingham v. Wilkinson, 516 So.2d 585 (Ala.1987); Bentley v. County Comm'n for Russell County, 264 Ala. 106, 84 So.2d 490, 493 (1955); Van Antwerp v. Board of Comm'rs of City of Mobile, 217 Ala. 201, 115 So. 239, 243 (1928); City of Foley, supra. The plaintiffs in this case have stated that the payment of certain legal fees has been unlawful. However, the plaintiffs must do more than allege their opinion that the municipal officials acted incorrectly. The complaint in this case does not allege that the duly elected municipal officials have exceeded the authority extended to them as the mayor and city council. Ala. Acts 1955, Act No. 452, amended by Ala. Acts 1965, Act No. 131, § 1.
For the reasons stated above, the complaint against the municipal defendants is due to be dismissed. The complaint against Donald Watkins is also due to be dismissed, because the plaintiffs have failed to state against him a claim upon which relief can be granted. There is no allegation that Watkins did not do the work for which he was paid and no allegation that he defrauded the City or colluded with anyone. The City of Birmingham has the authority to retain and to compensate attorneys to further the City's interests. City of Birmingham v. Wilkinson, supra, 239 Ala. at 203, 194 So. at 554. The mayor and city council retained Watkins, and he fully performed the services he was retained for. The plaintiffs allege no fraud, nor do they make any allegation that Watkins has been retained to represent any city official in any matter unrelated to his or her office.
The defendants also contend that they are entitled to a writ of mandamus on the grounds that the trial court abused its discretion in compelling discovery of documents the defendants say are protected by the attorney-client privilege and by the work product doctrine. They complain that counsel had worked out an agreement regarding discovery procedures, but that the trial judge refused to implement their agreement. In cases involving the exercise of discretion by an inferior court, the writ of mandamus may issue to compel the exercise of that discretion. Ex parte Smith, 533 So.2d 533 (Ala. 1988); Ex parte Edgar, supra. Although it is unnecessary to consider this issue, because we issue the writ on other grounds, we would note that recent amendments to the Alabama Rules of Civil Procedure encourage counsel to resolve discovery disputes. Rule 37(a)(2), A.R.Civ.P., as amended effective August 1, 1992, provides:
"A motion relating to discovery issues shall be accompanied by a statement of the attorney for the moving party stating that the attorney, before filing the motion, has endeavored to resolve the subject of the *1022 discovery motion through correspondence or discussions with opposing counsel or, if the opposing party is not represented by counsel, with the opposing party."
A similar provision was added the same date to Rule 26(c), A.R.Civ.P., pertaining to protective orders.
Based on the foregoing, we grant the petition and issue a writ of mandamus requiring the trial judge to dismiss the complaint.
WRIT GRANTED.
HORNSBY, C.J., and ALMON, SHORES, ADAMS, KENNEDY and INGRAM, JJ., concur.
