In an action, inter alia, for a judgment declaring null and void a resolution of the Town Board of the Town of Haverstraw, effective September 12, 1983, that a rental emergency exists as to apartment complexes containing 120 or more dwelling units and that such complexes are subject to regulation pursuant to the Emergency Tenant Protection Act of 1974, plaintiffs appeal, as limited by their brief, from so much of an order of the Supreme Court, Rockland County (Kelly, J.), dated May 10, 1984, as amended by an order of the same court, entered May 15, 1984, as denied their application for a preliminary injunction and granted the Town of Haverstraw’s cross motion to dismiss the action to the extent that the action was ordered dismissed in the event plaintiffs failed to join all affected tenants as parties to the action.
Order, as amended, modified, by deleting the provision thereof which ordered the action dismissed in the event plaintiffs failed to join all affected tenants as parties to the action and substituting therefor a provision denying the town’s cross motion in its entirety. As so modified, order, as amended, affirmed insofar as appealed from, without costs or disbursements.
Where the gravamen of an action for a declaratory judgment is the alleged invalidity of a governmental enactment, it is appropriate, as was done here, to permit intervention of persons for whose benefit the enactment was made (see Matter of Village of Spring Val. v Village of Spring Val. Housing Auth., 33 AD2d 1037). However, it is inappropriate to require, as a condition for maintaining the action, that plaintiffs add as defendants all persons beneficially affected by the enactment on the ground *691that they are necessary parties (cf. State of New York v Wolowitz, 96 AD2d 47).
We agree with Special Term that there was insufficient basis for the granting of a preliminary injunction or for ordering that “excess rents” be placed in escrow with the county clerk. Mollen, P. J., Titone, Bracken and Rubin, JJ., concur.