
    Erin BAKER v. CITY OF GUNTERSVILLE.
    2900766.
    Court of Civil Appeals of Alabama.
    April 10, 1992.
    Rehearing Denied May 15, 1992.
    
      Clyde D. Baker, Guntersville, for appellant.
    Tameria S. Driskill of Barnett & Driskill, Guntersville, for appellee.
   RUSSELL, Judge.

On July 26, 1991, Erin Baker filed a complaint against the City of Guntersville (city), alleging that the city through its building inspector issued a building permit to Crowley Cellular Telecommunications Huntsville, Inc. (Crowley), which, she claims, violated a city ordinance and denied her due process rights. She further alleged that notice was given to another neighbor and the attorney for Crowley, but that she received no notice of the permit. She asked that the trial court grant a judgment requiring that she be given notice by the board of adjustment (board) of the city and that the board be required to hold a public hearing to determine whether the building permit was properly issued or, in the alternative, to determine that the permit should be revoked. The trial court dismissed the complaint, finding that the action is barred by the doctrine of collateral estoppel. Baker appeals. We affirm.

The dispositive issue is whether the instant action is barred by the doctrine of collateral estoppel or by a related doctrine.

The pertinent facts are that Crowley, doing business as Cellular One as a provider of cellular radio telecommunication services, was issued a building permit on December 27, 1989, for the construction and operation of a telecommunications tower on property adjacent to Baker’s property.

On March 2, 1990, Baker gave notice of appeal to the board. She was notified by the city’s attorney that the appeal was not timely filed and could not be considered by the board. On March 8, 1990, Baker instituted an action in the Circuit Court of Marshall County against the city. The action was dismissed by the trial court, which found that Baker did not exhaust her administrative remedies. Baker did not appeal that decision.

On November 5, 1990, Baker filed a second action, a petition for writ of mandamus, against the board, demanding that the board be ordered to issue a ruling on her notice of appeal to the board. The trial court granted the writ, and the city appealed. On appeal, this court reversed and remanded the case with directions to the trial court to enter an order vacating the writ. See Board of Adjustment of Guntersville v. Baker, 587 So.2d 341 (Ala.Civ.App.1991).

Baker then filed the present case on July 26, 1991, which was dismissed on September 13, 1991. The trial court found that, although this court decided the former case on the propriety of the issuance of the writ of mandamus, Baker raised the same issues in her brief before this court and that, therefore, the present action is barred by the doctrine of collateral estoppel.

Baker contends that the trial court erred in dismissing the present action based on the doctrine of collateral estoppel and in finding that the same issues were raised as those argued in this court in the prior action. She claims that the issues of due process and the wrongful grant of the building permit are not the same issues decided by this court in the prior action, that the issues were not litigated in the prior suit, and that the resolution of the current issues were not necessary to determine the propriety of the writ of mandamus sought there. She also claims that, because the prior action was against the board and the present action is against the city, the parties are not the same.

The elements of collateral estoppel are: (1) that an issue is identical to the one litigated in the prior suit, (2) that the issue was actually litigated, (3) that resolution of the issue was necessary to the prior judgment, and (4) that the parties are the same. Dairyland Insurance Co. v. Jackson, 566 So.2d 723 (Ala.1990).

We conclude that, based on the facts presented, the resolution of the current issues of notice and a hearing were not necessary to the judgment which reviewed the grant of the writ of mandamus in the prior action. Therefore, the present action was not barred by the doctrine of collateral estoppel.

The city argues that the doctrine of res judicata applies in this instance, that the trial court is due to be affirmed even if the wrong reason is given for dismissal, and that the action is barred. We agree.

If the elements of res judicata are present, any claim that was adjudicated or that could have been adjudicated in the prior action is barred from further litigation. Dairyland, 566 So.2d 723. The four elements are: (1) a prior judgment on the merits, (2) rendered by a court of competent jurisdiction, (3) substantial identity of the parties, and (4) the same cause of action presented in both suits. This court’s judgment in the prior action held that the grant of the writ of mandamus directing the board to render a decision was improper because Baker’s notice of appeal was not filed within the thirty-day time limit and the jurisdiction of the board was not properly invoked. A dismissal for failure to state a claim, as well as a dismissal with prejudice and a dismissal on the grounds that the facts and law show no right to relief, is a dismissal on the merits. NAACP v. Hunt, 891 F.2d 1555 (11th Cir.1990). We hold that this court’s prior judgment was also a dismissal on the merits that was rendered by a court of competent jurisdiction.

Substantial identity of parties exists when res judicata is asserted against a party, or against one in privity with a party, to the prior action. NAACP, 891 F.2d 1555; Dairyland, 566 So.2d 723. In the present case, res judicata is asserted against Baker, a party to the prior action, and, therefore, there is substantial identity of the parties.

The last element of res judicata requires that the same cause of action is presented in both actions. The principal test to determine if the same cause of action exists is whether the primary right and duty or wrong are the same in each action. NAACP, 891 F.2d 1555. Res judi-cata applies to “all legal theories and claims arising out of the same nucleus of operative fact.” Id. at 1561. In other words, if the issues are the same and the same evidence would support a recovery in both suits, the same cause of action exists. Garris v. South Alabama Production Credit Ass’n, 537 So.2d 911 (Ala.1989). The issue is the same when it is supported by substantially the same evidence in both actions. Id. Both actions arose from the same alleged lack of notice and hearing, and, as noted by the trial court, Baker raises the same issues and presents the same evidence in the present case as argued in her brief in the prior case.

Based on the above, we hold that this action is precluded by res judicata. Although the trial court decided that the action was precluded by collateral estoppel, a correct decision will not be disturbed even if it is based on the wrong reasons. Boykin v. Magnolia Bay, Inc., 570 So.2d 639 (Ala.1990).

This case is due to be affirmed.

AFFIRMED.

ROBERTSON, P.J., and THIGPEN, J., concur.  