
221 Cal.App.3d 508 (1990)
270 Cal. Rptr. 527
FORT EMORY COVE BOATOWNERS ASSOCIATION et al., Plaintiffs and Appellants,
v.
C. MICHAEL COWETT et al., Defendants and Respondents.
Docket No. D009997.
Court of Appeals of California, Fourth District, Division One.
June 18, 1990.
*511 COUNSEL
Leo Shaw and John B. Barriage for Plaintiffs and Appellants.
Jennings, Engstrand & Henrikson, Arlene Prater, Lloyd M. Harmon, Jr., County Counsel, Daniel J. Wallace, Chief Deputy County Counsel, Gary C. Seiser and R. Mark Beesley, Deputy County Counsel, for Defendants and Respondents.
OPINION
HUFFMAN, J.
Plaintiffs Fort Emory Cove Boatowners Association, Lawrence S. Graf, Joyce Graf and James Morgan, Jr. (collectively Boatowners) appeal a judgment of dismissal after the court sustained without leave to amend the demurrers of defendants C. Michael Cowett, Kevin D. Bush, Wilson A. Schooley, Janet Sobel, Jennings, Engstrand & Henrikson, a professional law corporation, and Edwin L. Miller, Jr., District Attorney for the County of San Diego, on Boatowners' complaint to enjoin the San Diego Unified Port District (Port District) from paying for the prosecution of Port District ordinance violations. We conclude the demurrers were properly sustained without leave to amend because injunctive relief is not available to enjoin the appointment of deputy district attorneys to prosecute Port District ordinance violations. We further conclude the complaint fails to state facts sufficient to show any illegal expenditure of public funds. Accordingly, we affirm the judgment.

FACTUAL AND PROCEDURAL BACKGROUND
In February 1986, the Port District adopted ordinances establishing anchorages in certain parts of San Diego Bay and prohibiting anchorages in other parts of the bay. Boatowners who anchor their boats in prohibited areas of the bay received notices of a violation of the Port District ordinances. When they failed to move their boats from these areas, they were given misdemeanor citations. In a civil action, Boatowners unsuccessfully challenged the constitutionality of these ordinances. (See Graf v. San Diego Unified Port Dist. (1988) 205 Cal. App.3d 1189, 1191-1192 [252 Cal. Rptr. 889].) The law firm of Jennings, Engstrand & Henrikson (JEH) and attorneys Cowett, Bush, Schooley and Sobel represented the Port District in that lawsuit.
In January 1988, Cowett, Bush, Schooley and Sobel were appointed by District Attorney Miller as deputy district attorneys to prosecute the *512 misdemeanor Port District ordinance violations in the municipal court. On August 24, 1988, Boatowners sued the Port District, JEH, Cowett, Bush, Schooley, Sobel, and Miller for injunctive relief to prevent the expenditure of funds by the Port District for the expenses of hiring private attorneys to prosecute criminal violations of Port District ordinances. The complaint alleged Boatowners are California taxpayers who were then being prosecuted for alleged misdemeanor violations of Port District ordinances; the Port District and Miller agreed that JEH and its principals or associates Cowett, Bush, Schooley and Sobel would be retained and paid by the Port District to prosecute alleged violations of Port District ordinances; these attorneys would be appointed as deputy district attorneys; the appointment was made so as to give the appearance the cases were being prosecuted by deputy district attorneys as required by law; and these attorneys would be prosecuting Port District ordinance violations, even though such activity was expressly prohibited by Harbors and Navigation Code, appendix I, section 1 et seq. (the San Diego Unified Port District Act),[1] thereby accomplishing indirectly that which is prohibited by law. The complaint further alleged Cowett, Bush, Schooley and Sobel are Port District attorneys who have been prosecuting and would continue to prosecute persons charged with Port District ordinance violations unless enjoined by the trial court. The complaint prayed for a preliminary and permanent injunction enjoining the defendants from (a) spending Port District funds to pay for or subsidize the prosecution of alleged violations of Port District ordinances, (b) deputizing or employing private attorneys as deputy district attorneys who have or would receive funds from the Port District, and (c) receiving any Port District funds for the purpose of prosecuting Port District ordinance violations. The complaint requested an order directing JEH and Cowett, Bush, Schooley and Sobel to repay the Port District any funds it had already received for the prosecution of Port District ordinances.
In the meantime, Boatowners filed motions to recuse JEH and the individual attorneys from prosecuting the misdemeanor violations in their criminal cases. After the municipal court denied the motions, Boatowners filed a petition for writ of mandate in the superior court. The court granted the writ, finding the appointment of JEH and its attorneys as special prosecutors created a conflict of interest as well as the appearance of impropriety, and thus recused these attorneys from further prosecuting the criminal cases. The cases were then prosecuted by the district attorney's office, proceeded to jury trials and resulted in convictions.[2]
*513 The Port District, JEH, Cowett, Bush, Schooley, Sobel and Miller all filed demurrers to Boatowners' complaint. After hearing, the court sustained without leave to amend the demurrers of all defendants except the Port District, finding Boatowners had not alleged facts sufficient to constitute a cause of action as to these parties. The court further found injunctive relief was not available to prohibit the appointment of deputy district attorneys to prosecute alleged violations of law, and Boatowners had an adequate remedy at law as to these defendants. As to the Port District, the court sustained the demurrer with leave to amend, finding the allegations as to illegal expenditure of funds were conclusionary with no facts to support them. The court further found the Port District Act did not necessarily preclude the expenditure of funds for the prosecution of Port District ordinance violations, and specific factual allegations regarding the issue of alleged unauthorized expenditures would be required. The court entered judgment dismissing the action as to JEH, Cowett, Bush, Schooley, Sobel and Miller.[3] The Port District is not a party to this appeal.[4]

DISCUSSION
Boatowners contend their complaint alleges acts by Respondents sufficient to state a cause of action. Specifically, they assert (1) as citizens and taxpayers, they are authorized to obtain an injunction under Code of Civil Procedure section 526a preventing the illegal expenditure of public funds, and (2) the Port District Act prohibits the Port District from expending funds to prosecute alleged violations of its ordinances.

I
Code of Civil Procedure section 526a authorizes actions by a resident taxpayer against officers of a county, town, city, or city and county to obtain an injunction preventing the illegal expenditure of public funds. (1) "The primary purpose of this statute ... is to `enable a large body of the citizenry to challenge governmental action which would otherwise go unchallenged in the courts because of the standing requirement.' [Citation.]" (Blair v. Pitchess (1971) 5 Cal.3d 258, 267-268 [96 Cal. Rptr. 42, 486 P.2d 1242, 45 A.L.R.3d 1206].) Courts have been very liberal in applying the rule allowing taxpayers to bring an action to prevent the illegal conduct of public officials (id. at p. 268), and have even allowed taxpayers to sue on behalf of a city or county to recover funds illegally expended. (Osburn v. Stone (1915) 170 Cal. 480, 482 [150 P. 367].)
*514 (2) Here, Boatowners have alleged they are California residents and taxpayers. They are not suing on behalf of the city or county, but instead seek in their own right to enjoin the Port District from expending its own funds to pay for or subsidize the prosecution of alleged violations of Port District ordinances. However, the Port District is not a party to this appeal. Although Boatowners may properly challenge governmental action such as illegal "spending" under Code of Civil Procedure section 526a,[5] they have cited no authority, nor have we found any, allowing a taxpayers' suit, on behalf of the taxpayer individually, for illegally "receiving" public funds. (Cf. Miller v. McKinnon (1942) 20 Cal.2d 83 [124 P.2d 34, 140 A.L.R. 570].)[6]
Moreover, Code of Civil Procedure section 526a was not intended to be utilized to challenge the type of activity alleged here. Respondents Cowett, Bush, Schooley and Sobel were appointed to prosecute Port District ordinance violations as deputy district attorneys. Boatowners' personal interest in which deputy district attorney prosecutes their cases is not a proper purpose of a taxpayers' suit. Thus, Boatowners cannot state a cause of action against these respondents under Code of Civil Procedure section 526a.
(3) In their complaint, Boatowners also sought to enjoin respondent Miller from deputizing private attorneys as deputy district attorneys who have or would receive funds from the Port District. However, injunctive relief is not available "[t]o prevent the exercise of a public ... office, in a lawful manner, by the person in possession." (Code Civ. Proc., § 526, subd. 6 [second occasion of subd. 6].) Under Government Code section 24101, the district attorney may appoint deputies as necessary for the prompt and faithful discharge of the district attorney's duties. Here, respondents Cowett, Bush, Schooley and Sobel were lawfully appointed as deputy district attorneys and Boatowners do not contend otherwise. Respondent Miller, as public prosecutor, has chosen to prosecute Port District ordinance violations by duly appointed deputy district attorneys. The court cannot enjoin the exercise of that authority. (See Loftis v. Superior Court (1938) 25 Cal. App.2d 346, 357 [77 P.2d 491]; Younger v. Superior Court (1978) 83 Cal. App.3d 410, 412 [147 Cal. Rptr. 834].)


*515 II
(4a) Even if the complaint satisfied the requirements for a taxpayers' action, it fails to state facts showing any illegal expenditure of funds. (See County of Los Angeles v. Superior Court (1967) 253 Cal. App.2d 670, 678 [62 Cal. Rptr. 435].)
Section 59 provides: "Any person who violates the provisions of any ordinance, or any local police or sanitary regulation, of the board shall be guilty of a misdemeanor. The prosecution shall be conducted by the City Attorney of San Diego if the infraction occurred within the corporate limits of the City of San Diego on lands or waters subject to the jurisdiction of the district. The prosecution shall be conducted by the District Attorney of San Diego County if the infraction occurred without the corporate limits of the City of San Diego but otherwise on lands or waters subject to the jurisdiction of the district. The complaint shall be filed in the judicial district within which the infraction occurred."
Boatowners contend the language of section 59 stating the prosecution of Port District ordinance violations "shall" be conducted by the city attorney or the district attorney operates to bar the Port District from paying the costs of prosecution of those violations. They assert under this section the Port District is specifically prohibited from expending its funds to prosecute alleged violations of Port District ordinances. They further assert the Port District cannot hire attorneys with Port District funds and have them appointed as special deputy district attorneys because this violates the separation of the legislative function from the prosecutorial function which the Legislature mandated.

A
(5) A statute must be construed so as to harmonize its various parts within the statute's framework as a whole. (County of Orange v. Flournoy (1974) 42 Cal. App.3d 908, 914 [117 Cal. Rptr. 224].) Thus, in determining whether the Legislature intended to prohibit the Port District from expending its own funds to pay for the prosecution of violations of Port District ordinances, we must harmonize the language of section 59 with the entire Port District Act.
(4b) Under section 22, the board of commissioners may employ attorneys necessary in the work of the Port District. As part of the Port District's work, it is required to "[m]ake and enforce all necessary rules and regulations governing the use and control of all navigable waters ..." (§ 55, subd. (a)), as well as "[r]egulate and control the anchoring, mooring, *516 towing and docking of all vessels." (§ 55, subd. (b).) The Port District may also "do all other acts necessary and convenient for the exercise of its powers." (§ 35.) Construing these various sections together, it is clear the Port District may employ (and therefore pay) attorneys to perform any of these duties, including enforcement of its ordinances. Nowhere in the Port District Act is the ability to employ attorneys limited to civil matters.
Boatowners argue section 80 limits the purposes for which Port District funds may be used. That section provides in part: "... The money in or belonging to the fund shall not be appropriated or used for any purpose except those enumerated in this act...." However, section 81 allows the fund to be used "for the necessary expenses of conducting the district ..." and, in addition to that purpose, the money in the fund may be used for the "accommodation of commerce, navigation, fisheries, and recreation, or used in connection therewith; ..." The enforcement of Port District ordinances, whether through the use of private attorneys or other public agencies, is a necessary expense of conducting the Port District and, as such, is an appropriate purpose under these provisions.
Although section 59 states the prosecution shall be conducted by the city attorney or the district attorney, depending on where the infraction occurred, use of the word "shall" does not mean the Port District is precluded from providing the necessary resources to permit the district attorney's office to prosecute violations of Port District ordinances. (6) "Shall" is not necessarily mandatory, but instead may be construed as directory or permissive. (Hogya v. Superior Court (1977) 75 Cal. App.3d 122, 134 [142 Cal. Rptr. 325].) Whether a statute is mandatory or directory depends on the legislative intent as ascertained from a consideration of the entire act. (Francis v. Superior Court (1935) 3 Cal.2d 19, 28 [43 P.2d 300].)
(4c) Here, the word "shall" is not a limitation on the authority of the Port District, but instead delineates which office, the city attorney or the district attorney, has jurisdiction to prosecute ordinance violations depending on where the infraction occurred. To read "shall" as mandatory would eliminate the broad discretion vested in prosecutors in deciding whether to initiate a prosecution of a particular violation and instead require they prosecute every Port District ordinance violation. (See Gov. Code, § 26500; People v. Gephart (1979) 93 Cal. App.3d 989, 999 [156 Cal. Rptr. 489].) (7) Where, as here, the language of the statute permits an alternative interpretation, a literal construction leading to absurd results should not be chosen. (Jersey Maid Milk Products Co. v. Brock (1939) 13 Cal.2d 620, 648 [91 P.2d 577].) (4d) Based on a reasonable interpretation of the Port District Act, we conclude the Port District has within its authority the *517 ability to expend its own funds to support the prosecution of violations of its ordinances governing the use and control of navigable waters.
Moreover, as we previously recognized, the district attorney may appoint deputies as necessary for the prompt and faithful discharge of its duties. (Gov. Code, § 24101.) Under Government Code section 26520, the district attorney may render legal services to local public entities, and unless required to do so without fee, may charge a fee not to exceed the total cost to the county. Here, respondent Miller appointed respondents Cowett, Bush, Schooley and Sobel as deputy district attorneys for the purpose of representing the People of the State of California in Port District ordinance violations. If, under Government Code section 26520, the Port District would be required to pay the district attorney for its legal services, we see no reason why the Port District could not pay the attorneys providing the services.
Boatowners assert allowing the Port District to hire attorneys with Port District funds and then have them appointed as special deputy district attorneys violates the separation of the legislative function from the prosecutorial function which the Legislature has mandated. However, Respondents' function as special prosecutors no more violates the separation of powers than does the city attorney's duties to "frame all ordinances and resolutions required by the legislative body" (Gov. Code, § 41802) as well as prosecute persons accused of violating city ordinances. (Gov. Code, § 41803; Montgomery v. Superior Court (1975) 46 Cal. App.3d 657, 666 [121 Cal. Rptr. 44].)

B
Boatowners contend the court erred in ruling they have an adequate remedy at law because recusal motions (Pen. Code, § 1424) on a case-by-case basis are available to them. They assert this ruling precludes citizens not charged with a crime from bringing an action to enjoin the illegal expenditure of public funds.[7] In light of our holding the Port District properly expended its funds to prosecute violations of its ordinances, we will comment only briefly on this issue. We do so since we do not rely on the possibility of court recusal of special prosecutors as a basis of our decision *518 to affirm the trial court. The transcript of the proceedings on October 7, 1988, in Graf v. Superior Court, case number 598079, is contained in the clerk's transcript and we are therefore familiar with at least one instance of a recusal. The merits of that decision are not before us and we do not wish to imply an opinion as to whether the Superior Court's decision to recuse respondents Cowett, Bush, Schooley and Sobel from further prosecuting Port District ordinance violations was correct. We will wait for another day and a complete record before we venture haplessly into that thicket.

DISPOSITION
The judgment is affirmed.[8]
Todd, Acting P.J., and Benke, J., concurred.
NOTES
[1]  All statutory references are to the Harbors and Navigation Code, appendix I (also referred to as the Port District Act) unless otherwise specified.
[2]  Boatowners' sentences were stayed pending appeal to the appellate department of the superior court. We have been informed at oral argument Boatowners' convictions were reversed and reset for trial.
[3]  Where convenient, we refer to JEH, Cowett, Bush, Schooley, Sobel and Miller collectively as Respondents throughout the rest of the opinion.
[4]  Further proceedings as to the Port District's first amended complaint have been stayed pending this appeal.
[5]  We do not mean to imply in any way that Boatowners have a viable cause of action against the Port District. Rather, our statement that a taxpayer has a right to maintain an action against a public entity reaches only the question of who may be a proper defendant in those suits.
[6]  In Miller, on which Boatowners rely, the court held "a right of action exists to recover moneys paid to a contractor for work and materials furnished the public agency where they were furnished in contravention of a statute requiring competitive bidding." (Miller v. McKinnon, supra, 20 Cal.2d at p. 89.) However, in that case, the plaintiff had sued on behalf of the county as well as himself and had also sued the district attorney for failing to recover the money illegally expended. (Id. at pp. 95-96.) The complaint here alleges no such facts.
[7]  In arguing recusal motions are an inadequate remedy, Boatowners state: "Since it is perfectly possible for the port district to pay special deputies who were independent and not previously aligned with the Port District, in such a case the defendant could not obtain relief because he could not show he would not receive a fair trial and the illegal activity would continue unabated." (Italics added.) In essence, Boatowners concede the Port District's expenditure of funds to prosecute violations of its ordinances is permissible and instead focus their attack on the particular attorneys appointed, who they argue are "biased private attorneys ... [having] a personal interest in the outcome of [Boatowners'] criminal proceedings." Such allegations of bias support the court's finding recusal was an adequate remedy.
[8]  Having decided the issues on appeal in favor of Respondents, we need not address Boatowners' argument they are entitled to attorney's fees under the private attorney general doctrine.
