OPINION OF THE COURT
Leventhal, J.This appeal raises two issues for the Court’s consideration relating to the Accessory Apartment Law of the Town of Huntington (Town Code of Town of Huntington § 198-132 et seq.). The first issue is whether the Accessory Apartment Bureau of the Town of Huntington Department of Public Safety, a quasi-judicial tribunal, had jurisdiction to adjudicate a violation of the Town Code of the Town of Huntington (hereinafter the Town Code) and to revoke the petitioners’ accessory apartment permit. The second issue is whether the Town of Huntington can condition the use of an accessory apartment upon the requirement that a homeowner consent to a warrantless search of his or her residence. For the reasons discussed below, we address the merits of the former issue, but not the latter.
Accessory Apartment Law
In 1991 the Town of Huntington created the Accessory Apartment Law, with the intent to “meet the special housing needs of small households and to allow for the efficient use of the Town’s existing stock of single-family dwellings” (Town Code § 198-132 [A]). The Accessory Apartment Law also sought “to increase compliance with building and fire codes, assist individuals and families with limited incomes, reduce the impact of foreclosure and deferred property maintenance” (id.). Pursuant to the Accessory Apartment Law, an owner of a single-family dwelling *308could apply to a Hearing Officer1 for an “accessory apartment permit” to maintain an accessory apartment. Such a permit could only be granted after a public hearing (see Town Code §§ 198-134, 198-136, 198-137).
Once an owner obtained an accessory apartment permit, he or she could maintain certain features on his or her property which are generally associated with a multi-family dwelling.2 Nevertheless, such a dwelling would still be zoned for single-family occupancy. As a condition of the issuance of an accessory apartment permit, the premises would be subject to “inspection by the Director of the Department of Public Safety, or his/her designee, for the purpose of determining whether the apartment is in compliance with the [Town Code], the New York State Uniform Fire Prevention and Building Code [hereinafter the Building Code] and/or the rules and regulations of any other agency having jurisdiction” (Town Code § 198-134 [D] [1]). Section 198-134 (D) (1) provides that a fee of $75 would be imposed upon the property owner for each inspection that is required to be rescheduled.3 Furthermore, any entity responsible for a violation of section 198-134 (D) (1), as determined by the Hearing Officer, would be subject to a fine or penalty of not less than $250 and not more than $500 for each week an inspection “is *309not conducted or cannot be completed” (Town Code § 198-148 [C]). Review of a Hearing Officer’s determination regarding the interpretation of any provision of the Accessary Apartment Law could be obtained solely by a CPLR article 78 proceeding (see Town Code § 198-147 [A]).
*308“[a]n inspection by the Director of the Department of Public Safety, or his/her designee, for the purpose of determining whether the apartment is in compliance with the [Town] Code, the [Building Code] . . . and/or the rules and regulations of any other agency having jurisdiction. The failure to schedule an inspection after due notice from the Town or resisting, obstructing and/or impeding the agents, servants, officers and/or employees of the Town of Huntington during an inspection of the premises shall be a violation of this Article and subject to the fines and penalties provided herein. A fee of seventy-five ($75) dollars shall be imposed upon the owner of the property for each inspection that is required to be rescheduled.”
*309Background
The petitioners, Joan Stoffer and Harvey Stoffer, reside at a single-family residence located in Huntington Station. In February 1992 the Town’s Accessory Apartment Review Board (hereinafter the AARB) issued an accessory apartment permit for the Stoffers’ property, which was then owned by a nonparty. The issuance of the accessory apartment permit was conditioned upon, among other things, the then-owner’s consent to inspection of the property upon reasonable notice.
In February 1998 the Stoffers’ application to transfer the accessory apartment permit to themselves was granted. In the notarized transfer application, the Stoffers agreed to, inter alia, “periodic inspections pursuant to [Town Law] § 198-133 (D).” In February 2007 the Stoffers’ sworn application for a renewal of the accessory apartment permit was granted; as part of the application, the Stoffers “ consent [ed] to periodic inspections pursuant to § 198-136 (D).”
On November 15, 2007 the Town of Huntington Department of Public Safety Code Enforcement Division issued a notice of violation to the Stoffers for the noncertified use and operation of a kennel on the premises. The notice of violation gave the Stoffers until November 29, 2007 to comply and stated “FAILURE TO COMPLY MAY RESULT IN THE ISSUANCE OF SUMMONSES TO THE ABOVE NAMED PARTIES AND/OR [REFERRAL] TO ACC APT REVIEW BOARD FOR POSSIBLE REVOCATION HEARING.”
By letter dated December 7, 2007, the Stoffers informed the Town Clerk that they had an expectation of privacy in their property and that the Town’s employees and agents were not permitted entry therein.
Thereafter, the Town notified the Stoffers that it had scheduled a hearing to determine whether the accessory apartment permit should be revoked on the ground that the Stoffers failed to comply with Town Code § 198-134 (D) (1), which requires property owners to permit Town officials to enter their property for the purpose of determining whether the accessory apartment is in compliance with various codes.
*310Hearing
On February 4, 2008 a hearing was held before the respondent Edward J. Nitkewicz, Chairman and Hearing Officer of the Town Accessory Apartment Bureau (hereinafter the AAB). The AAB is an administrative tribunal which, according to the Town, was authorized to determine whether the Stoffers had violated the Town’s Accessory Apartment Law. At the hearing, the Stoffers’ counsel argued that the Town Code provision granting an accessory apartment permit conditioned upon the homeowner’s consent to an inspection of his or her property was unconstitutional. The Hearing Officer replied that the Stoffers had consented to the search of their property, which consent was listed as a condition on their prior application to renew their accessory apartment permit.
Hearing Officer’s Determination
Following the hearing, by letter dated March 24, 2008, Nitkewicz issued a determination revoking the Stoffers’ accessory apartment permit. The basis for revocation was the Stoffers’ failure to comply with Town Code § 198-134 (D) (1), which requires property owners to permit access to public officials on a periodic basis in order to determine compliance with various codes.
In a letter to the Stoffers which accompanied the determination, the Hearing Officer stated: “You must notify your tenants to vacate the premises, convert the premises back to a single-family dwelling and complete a removal inspection within forty-five days to avoid further legal action.” The letter indicated that a May 16, 2008 inspection of the Stoffers’ property by the AAB had been scheduled to ensure compliance.
The Instant Proceeding
The Stoffers commenced this CPLR article 78 proceeding against the Huntington Department of Public Safety and Nitkewicz, individually and in his capacity as Hearing Officer (hereinafter together the appellants), inter alia, to review Nitkewicz’s determination, averring, inter alia, that Town Code §§ 198-143—198-148 are unconstitutional. In addition, the Stoffers argued that the law only allowed an inspection of an owner’s property at the time the owner first sought the issuance of an accessory apartment permit, and was therefore inapplicable to a renewal application.
The Stoffers also contended that, in light of the determination of the Supreme Court, Suffolk County, in Greens at Half *311Hollow, LLC v Town of Huntington (15 Misc 3d 415 [2006]), the Town was improperly adjudicating land use violations. As a result, the Stoffers argued, the subject Town Code provisions were established in derogation of the Unified Court System’s jurisdiction over such violations, as authorized by the State Legislature and the New York State Constitution. The appellants answered the petition, and argued that the Stoffers had no right to an accessory apartment permit and, therefore, no right to the issuance of such a permit. The appellants further contended that the permit may then be conditioned upon requiring periodic access to public officials. The appellants contended that the holding in Sokolov v Village of Freeport (52 NY2d 341 [1981]) was inapplicable because that case involved businesses zoned for rental use, whereas the instant case involved units zoned for single-family residential use. The appellants further argued that Greens at Half Hollow, LLC v Town of Huntington (15 Misc 3d 415 [2006]) was distinguishable. In addition, the appellants asserted that the subject codes do not require warrant-less searches; rather, the appellants maintained that the searches were conducted on notice to the homeowner.
Judgment Appealed From
In a judgment dated December 22, 2008, the Supreme Court granted that branch of the petition which was to annul the Hearing Officer’s determination. The Supreme Court held that the Court of Appeals’ decision in Sokolov v Village of Freeport (52 NY2d 341 [1981]) prohibited the Town “from conditioning their continued use of an accessory apartment . . . upon the requirement that [the owners] consent to a warrantless search of the premises.” (2008 NY Slip Op 33609[U], *1.) The Supreme Court stated that “[t]he Court need not reach the constitutional question of whether the . . . Town is authorized under the New York State Constitution to create its own tribunal to hear violations of its zoning law and thereby supplant the function of the District Court.” (Id.)
On appeal, the appellants argue that the issuance of an accessory apartment permit is a privilege and not a right. Therefore, they maintain, the Town can require property owners to consent to periodic inspections. The appellants further contend that any purported right to an accessory apartment is not guaranteed under the United States or New York Constitution.
In response, the Stoffers argue that the warrantless search provision of the Accessory Apartment Law is unconstitutional.
*312In the alternative, the Stoffers argue that the determination should be vacated because the law on which it was premised was arbitrary and not related to a legitimate state interest (i.e., public health, safety, welfare, morals). On appeal, the Stoffers also urge this Court to consider the alternate issue that the Supreme Court declined to reach: whether an administrative tribunal such as the AAB has jurisdiction to adjudicate zoning law violations.
For the reasons set forth below, we affirm, but bn the alternate ground not addressed by the Supreme Court.
In the judgment appealed from, the Supreme Court declined to reach the issue of whether the AAB had jurisdiction to hear violations of its zoning law, and thereby supplant the function of the District Court. Instead, the Supreme Court elected to address the issue of whether the Town’s warrantless search provision was unconstitutional.
We find that the issue of whether the AAB had jurisdiction to adjudicate violations of the Town Code is a prerequisite to any additional determination as to the constitutionality of the Accessory Apartment Law’s warrantless search provisions and, therefore, must be addressed. To the extent that the appellants contend that the issue of whether the AAB had jurisdiction to adjudicate violations of the Town Code is not properly before this Court, this Court may review the Stoffers’ alternate basis for annulling the Hearing Officer’s determination even though the Stoffers did not cross-appeal from the judgment. The Stoffers could not. cross-appeal from the judgment because they were not aggrieved thereby, since their petition was granted (see CPLR 5511). Moreover, this Court may review the alternate ground for relief alleged in the petition as a basis for affirmance (see Parochial Bus Sys. v Board of Educ. of City of N.Y., 60 NY2d 539, 546 [1983]; Matter of Long Is. Affordable Homes, Inc. v Board of Appeals of Town of Hempstead, 57 AD3d 996, 998 [2008]). In addition, the issue presented relates to the lack of subject matter jurisdiction of the AAB, a ground for relief that cannot be waived and can be raised at any stage of a proceeding (see Financial Indus. Regulatory Auth., Inc. v Fiero, 10 NY3d 12, 17 [2008]).
The question of whether a municipality may create an administrative tribunal to try land use violations was addressed in a December 2003 informal opinion by the New York State At*313torney General (see 2003 Ops Atty Gen No. 2003-18).4 There, the Attorney General opined that the New York Constitution and the Municipal Home Rule Law prevented the Town of Hamburg from establishing such a tribunal.
Similarly, an almost identical question as presented here was decided against the Town in Greens at Half Hollow, LLC v Town of Huntington (15 Misc 3d 415 [2006]). In Greens at Half Hollow, LLC v Town of Huntington, the plaintiff sought a declaration that the Town had unlawfully created a Zoning Violations Bureau “to operate as an administrative tribunal ... to hear and adjudicate all town land use codes, i.e., zoning and land use resolutions” (id. at 416). The Chief Administrative Judge intervened in support of the plaintiff, arguing that the administrative tribunal was an “unconstitutional usurpation of the judicial function which rests exclusively with the New York State Unified Court System” (id.). The Supreme Court agreed and declared that the Zoning Violations Bureau was unconstitutional (id. at 424).
Although both 2003 Opinions of the Attorney General No. 2003-18 and Greens at Half Hollow, LLC v Town of Huntington (15 Misc 3d 415 [2006]) are informative on the issue presented, neither is binding on this Court.
New York Constitution, article VI, § 30, states, in pertinent part, that “[t]he legislature shall have the same power to alter and regulate the jurisdiction and proceedings in law and in equity that it has heretofore exercised” (emphasis added). Acting pursuant to this authority, the State Legislature has enacted several relevant statutes. First, the Legislature has granted, to the District Court, the following authority regarding actions to recover civil penalties for local code violations:
“The court shall have jurisdiction of the following actions provided that the real property involved is located in whole or in part within a district of the court in the county . . .
“(2) An action brought to impose and collect a civil penalty for a violation of state or local laws for the establishment and maintenance of housing standards, including, but not limited to, the multiple dwelling law, the multiple residence law, and any *314applicable local housing maintenance codes, building codes and health codes . . .
“(6) An action or proceeding for the issuance of an injunction, restraining orders or other orders for the enforcement of housing standards under any law described in paragraph (2) of this subdivision” (UDCA 203 [a] [2], [6] [emphasis added]).
Second, the Penal Law and Town Law, when read together, establish the jurisdiction of the courts to try criminal actions to enforce code violations. Under the Penal Law, “Local Criminal Court[s]” (CPL 10.10 [3] [a]) have jurisdiction to try “petty offenses” and “misdemeanors” (CPL 10.30 [1]). The District Court is among the courts defined as a local criminal court (see CPL 10.10 [3]). The superior courts, which include the Supreme Court and the County Court (see CPL 1.20 [20]; 10.10 [2]), have, among other things, jurisdiction to try misdemeanors concurrent with that of the local criminal courts, and jurisdiction to try petty offenses,5 6 but only when such petty offense is charged in an indictment which also charges a crime (see CPL 10.20. [1] [b], [c]).6 The Town Law provides that violations of ordinances, rules, and regulations will be deemed misdemeanors or offenses for jurisdictional purposes as follows:
“A violation of any ordinance, rule or regulation adopted by the town board pursuant to this chapter is hereby declared to be a misdemeanor except as otherwise provided by law and except that any such violation of a provision of a town building code or zoning ordinance shall be deemed an offense against such code or ordinance, and the town board may provide for the punishment thereof by fine or imprisonment or both; provided, however, that for the purpose of conferring jurisdiction upon courts and judicial officers generally, violations of a town building code or zoning ordinance shall be deemed misdemeanors and for such purpose only all provisions of law relating to misdemeanors shall apply to such violations. It is also empowered to provide civil penalties for such violation. The town board may also maintain an action or proceeding in the name *315of the town in a court of competent jurisdiction to compel compliance with or to restrain by injunction the violation of any such ordinance, rule or regulation, notwithstanding that the ordinance, rule or regulation may provide a penalty or other punishment for such violation” (Town Law § 135 [1] [emphasis added]).
Thus, although a violation of a zoning or building code is an offense, it is deemed for jurisdictional purposes to be a misdemeanor which would enable both local superior courts and local criminal courts to exercise jurisdiction over a criminal action to enforce such a violation. Construing the applicable sections of the Penal Law and the Town Law, it is evident that the Legislature conferred jurisdiction over civil actions to enforce ordinance violations upon the District Court, and conferred jurisdiction over criminal enforcement actions upon the superior courts and to the local criminal courts.
“As a matter of constitutional and statutory delegation, local governments are authorized to legislate in enumerated areas of local concern, subject to the Legislature’s overriding interest in matters of statewide concern” (Matter of Cohen v Board of Appeals of Vil. of Saddle Rock, 100 NY2d 395, 399 [2003], citing NY Const art DC). The Municipal Home Rule Law provides that a town has the power to amend or supersede “any provision of the town law relating to the property, affairs or government of the town or to other matters in relation to which and to the extent to which it is authorized to adopt local laws by this section, notwithstanding that such provision is a general law, unless the legislature expressly shall have prohibited the adoption of such a local law” (Municipal Home Rule Law § 10 [1] [ii] [d] [3]; see Matter of Cohen v Board of Appeals of Vil. of Saddle Rock, 100 NY2d at 400). Where the Legislature has not expressly forbidden local governments from superseding state law, a local government may nevertheless be prohibited from enacting superseding legislation, pursuant to the doctrine of preemption, where the State has evidenced an intent to occupy the field (see Matter of Cohen v Board of Appeals of Vil. of Saddle Rock, 100 NY2d at 400; Kamhi v Town of Yorktown, 74 NY2d 423, 430 [1989]; Albany Area Bldrs. Assn. v Town of Guilderland, 74 NY2d 372, 377 [1989] [“Preemption applies both in cases of express conflict between local and State law and in cases where the State has evidenced its intent to occupy the field”]).
*316The New York Constitution limits a local government’s power to interfere with the Legislature’s authority to define the jurisdiction of the courts. Specifically, article IX of the New York Constitution provides that local governments have the power to “adopt and amend local laws not inconsistent with the provisions of this constitution or any general law” (NY Const, art IX, § 2 [c] [i] [enumerating various areas in which local governments are guaranteed the authority to act]). However, this right is tempered by New York Constitution, article IX, § 3 (a) (2), which provides that “[e]xcept as expressly provided, nothing in this article shall restrict or impair any power of the legislature in relation to . . . [t]he courts as required or provided by article VI of this constitution.” As discussed above, New York Constitution article VI grants the Legislature certain powers to regulate the jurisdiction of the courts (see NY Const, art VI, § 30 [“The legislature shall have the same power to alter and regulate the jurisdiction and proceedings in law and in equity that it has heretofore exercised”]). In light of this specific grant of power to the Legislature, it follows that local governments are prohibited from implementing local laws which affect the jurisdiction of the courts. Thus, a municipality such as the Town is expressly prohibited from abrogating or superseding the jurisdictional framework created by the Legislature in order to try zoning violations in an administrative tribunal.
Assuming, arguendo, that the New York Constitution could be read so as to permit some local legislative action affecting the jurisdiction of the courts, it is submitted that the Legislature has preempted local governments from doing so in the area of code enforcement. The Legislature has provided a method by which local governments of a certain size may create administrative tribunals to adjudicate violations of local ordinances and codes. In particular, General Municipal Law article 14-BB permits “[a]ny municipality having a population of more than three hundred thousand but less than three hundred fifty thousand [to] adopt a local law establishing an administrative adjudication hearing procedure ... for all code and ordinance violations” (see General Municipal Law § 380). Here, the appellants do not argue that the AAB was an administrative tribunal established pursuant to the General Municipal Law.7 Accordingly, in light of the Legislature’s specific pronouncement *317regarding the conditions under which it will permit the creation of an administrative tribunal for the purposes of code enforcement, it is clear that the Legislature sought to preempt local governments that do not meet those conditions from creating such tribunals. Indeed, a contrary conclusion, permitting the Town to create an administrative tribunal for the purposes of code enforcement, without meeting the conditions created by the Legislature in General Municipal Law § 380, would render those conditions a nullity. Moreover, the fact that the Legislature has determined that the purpose of deeming code violations to be offenses and misdemeanors is to confer jurisdiction upon the Judiciary (see Town Law § 135 [1]) further supports our finding that the Legislature intended to preempt local governments from creating alternative tribunals for the adjudication of such offenses. Notwithstanding the above discussion, the appellants argue that in Kasper v Town of Brookhaven (142 AD2d 213 [1988]), this Court “specifically determined that the establishment by a local municipality in a town of an Accessory Apartment Review Board was neither unconstitutional nor did the municipality exceed the legislative powers granted to it in the Town Law.” As a result, the appellants contend, this Court has already determined that the Town’s legislature was authorized to create a tribunal to adjudicate violations of the Town Code. We reject the appellants’ position, as they mischaracterize the question presented in Kasper. In any event, Kasper did not address the essential issue in the matter at bar.
The issue in Kasper was whether the Town of Brookhaven could create an accessory apartment law which limited the total number of accessory apartment permits that the Town of Brook-haven would allow at one time in a given geographic area, thus prohibiting new applications for permits once the limit had been reached {id. at 214-215). Kasper did not address whether an administrative body could adjudicate violations of a town’s ordinances and codes. The issue presented here is not whether a municipality may establish a board for the purposes of reviewing and granting accessory apartment applications, but whether a quasi-judicial tribunal created by the Town had jurisdiction to adjudicate a violation of the Town Code.
Accordingly, the determination of the Hearing Officer that the Stoffers were in violation of the Accessory Apartment Law *318and revoking the Stoffers’ accessory apartment permit must be annulled because the AAB was without jurisdiction to try the matter (see CPLR 7803 [2]; Matter of Holtzman v Goldman, 71 NY2d 564, 569 [1988]).
Remaining Contentions
Since the AAB was without jurisdiction to adjudicate a violation of the Town’s zoning code and to revoke the Stoffers’ accessory apartment permit, the question of whether the provision of the Accessory Apartment Law requiring the Stoffers to consent to warrantless searches of their home is unconstitutional has been rendered academic. Further, as discussed below, because the Town’s legislature is not a party to this proceeding, this Court is unable to consider the constitutional question.
Although the petition purportedly sought declaratory relief, the Stoffers were not entitled to such relief even if the claim were properly interposed, since they failed to join a necessary party. Although this Court has the power, pursuant to CPLR 103 (c), to convert a proceeding into an action, that power is conditioned upon the Court having jurisdiction over all of the necessary parties (see Matter of Garden City Ctr. Assoc. v Incorporated Vil. of Garden City, 193 AD2d 740 [1993]; see also Matter of Overhill Bldg. Co. v Delany, 28 NY2d 449, 458 [1971]). In a matter seeking a declaratory judgment challenging a legislative act, the legislative body that enacted the challenged law or ordinance is a necessary party. Since the Town Board of the Town of Huntington was not named as a party or joined, this Court cannot exercise its authority pursuant to CPLR 103 (c) (see Matter of Garden City Ctr. Assoc. v Incorporated Vil. of Garden City, 193 AD2d at 740 [“In an action seeking to declare a legislative act of a village invalid, the Board of Trustees of the Village would be necessary parties”]; see also Matter of Overhill Bldg. Co. v Delany, 28 NY2d 449, 458 [1971] [“in actions for judgment declaring unconstitutional a legislative act of the village, the village trustees would be necessary parties”]; Matter of Board of Educ. of Glen Cove City School Dist. v O’Shea, 304 AD2d 662, 663 [2003]; cf. Matter of Perrin v Bayville Vil. Bd., 70 AD3d 835, 836 [2010] [noting that “personal jurisdiction was obtained over all of the necessary parties,” this Court converted CPLR article 78 proceeding challenging legislative act to declaratory judgment action where Village Board of Trustees had been made a party]).
*319Accordingly, the judgment is affirmed.
Miller, J.P., Chambers and Lott, JJ., concur.
Ordered that the judgment is affirmed, without costs or disbursements.
. The Hearing Officer, who is appointed by the Town Attorney, is compensated with a salary provided by the Town Board (see Town Code § 198-139).
. For example, in the absence of a valid accessory apartment permit, there is a rebuttable presumption in the Accessory Apartment Law that a building or dwelling unit zoned for single or one-family occupancy was occupied by more than one family, if, for example, two or more of the following features were found to exist on the premises: more than one mailbox, more than one gas meter, more than one electric meter, more than one connecting line for cable or utility services, or more than one entrance (see Town Code § 198-133 [CJ]).
. Specifically, Town Code § 198-134 (D) (1) provides that, as a condition of the issuance of an accessory apartment permit, a homeowner must consent to
. See also 2000 Ops Atty Gen No. 2000-21; 1997 Ops Atty Gen. No. 97-43; 1993 Ops Atty Gen [Inf Ops] 7; 1982 Ops Atty Gen [Inf Ops] 57; 1980 Ops Atty Gen [Inf Ops] 243.
. Petty offenses include a violation or a traffic infraction (see CPL 1.20 [39]).
. See People v Fernandez, 72 AD3d 303 (2010), affd 15 NY3d 213 (2010) (discussing the superior courts’ jurisdiction over unindicted misdemeanors).
. Nor would the Town appear to qualify under the program in General Municipal Law article 14-BB even if it desired to create such a program. For example, the U.S. Census Bureau estimated the population of the Town of *317Huntington to be 195,289 in the year 2000 and, based upon projections, to be 201,594 in 2008 (see http://factfinder.census.gov/home/saff/main.html?_lang=en [last accessed Apr. 8, 2010]). Thus, based on its population, the Town would be ineligible for the program, which requires a minimum population of 300,000.