
    J. David Beneke, Individually and as Trustee of the J. David Beneke Trust, Appellant, v Town of Santa Clara et al., Respondents.
    [814 NYS2d 315]
   Peters, J.

Appeal from an order of the Supreme Court (Demarest, J.), entered September 9, 2005 in Franklin County, which, inter alia, denied plaintiffs motion to dismiss a counterclaim by defendant Town of Santa Clara.

During the fall of 2001, plaintiff, as the trustee of the J. David Beneke Trust, began constructing a “floating boathouse” off the shore of his property on Upper Saranac Lake. His failure to apply for a building permit or variance from defendant Town of Santa Clara was the subject of a prior proceeding before this Court (Matter of Beneke v Town of Santa Clara, 9 AD3d 820 [2004]). There, plaintiff unsuccessfully sought to prohibit the Town from prosecuting him. In February 2005, plaintiff commenced this declaratory judgment action seeking, among other things, to prohibit the Town from having the boathouse removed. The Town thereafter commenced an action seeking a permanent injunction and an order compelling removal of the boathouse; these actions were consolidated by agreement and the Town’s action became the counterclaim to plaintiffs action. Plaintiff unsuccessfully moved to dismiss the Town’s counterclaim pursuant to CPLR 3211 (a) (3) and (7), thus prompting this appeal.

Presented with a motion to dismiss under CPLR 3211, we must accept the facts alleged in the counterclaim as true and accord the nonmoving party “the benefit of every possible favorable inference and determine only whether the facts as alleged fit within any cognizable legal theory” (Sokoloff v Harriman Estates Dev. Corp., 96 NY2d 409, 414 [2001]; see Griffin v Anslow, 17 AD3d 889, 891 [2005]). Plaintiff contends, in support of his motion under CPLR 3211 (a) (7), that since the Town only alleges a violation of the New York State Uniform Fire Prevention and Building Code (hereinafter code), and not a local law which is required before it can seek enforcement of the code, the counterclaim fails to state a cause of action. The Town, in response, acknowledged in its pleadings that its enforcement of the code must be accomplished through the enactment of a local law (see Executive Law § 381 [2]; 19 NYCRR 1203.2 [a]). To comply with that mandate, the Town adopted Local Law No. 1 (1989) of the Town of Santa Clara and authorized its code enforcement officer, under Local Law No. 1 (1993), to, among other things, enforce the code. Since the Town alleges that plaintiff was required to obtain a building permit from it prior to any “site preparation, construction, enlargement, alteration, improvement, removal or demolition of buildings or structures,” the failure to do so violated the code. As we are required to accept these facts as true (see Griffin v Anslow, supra at 891), we find no basis for a dismissal. To the extent that plaintiff further asserts that the boathouse is not subject to the Town’s regulation under the code, the Town’s allegations that “[t]he boathouse is a structure under the [code]” and is within its territory, is sufficient, in our view, to survive this motion at this juncture.

Next addressing plaintiffs contention that the Town did not have capacity to sue under Executive Law § 382 (3) since it is neither “an appropriate municipal officer” or “person aggrieved by the violation,” we note that the Town is a municipal corporation (see Town Law § 2) and, as a corporation, has the right to sue and be sued in all courts like a natural person (see NY Const, art X, § 4; see also Andraka v Town of Pompey, 1 AD2d 427, 431 [1956], lv dismissed 2 NY2d 720 [1956]). Failing to find that its commencement of this action was contrary to its authorized enforcement power (see Executive Law §§381, 382 [1]; see also Executive Law § 371 [2] [b] [5]; [d]; see generally Matter of ATM One v Landaverde, 2 NY3d 472, 476-477 [2004]), we affirm.

Mercure, J.P., Carpinello, Mugglin and Lahtinen, JJ., concur. Ordered that the order is affirmed, without costs. 
      
      . In August 2004, plaintiff was convicted in Town Court of violating the town ordinance that required him to obtain a permit. He appealed to County Court, which has not yet rendered a decision.
     
      
      . To the extent that plaintiff contends, on appeal, that Supreme Court lacks subject matter jurisdiction, we note that the motion to dismiss was not premised upon CPLR 3211 (a) (2). While Supreme Court has not yet addressed this issue and this contention can be raised at any time, we decline to address it at this juncture.
     