Privity is a key principle in contract law. Those who are parties to the contract can sue on it. Those who aren't, cannot.
Even in contracts where a huge number of people can sue, it's usually because each of that huge number of people is a party to the contract. (For example, ten million people download some open source software, where each individually is a party to an offer and implied acceptance of licensing terms).
But what if I wanted to specifically write a contract in which the essence was that anyone could sue to enforce it, not just the parties? What is the magic phrasing, or legal mechanism, to do so?
- I want to enter a contract with B, where (as a contractor) I give copyright of software I write for B's business to B, and as part of consideration, B agrees to make it publicly available for free download under an appropriate open source license, within at most 3 years. I want anyone in the world to be able to sue to enforce that, so that it doesn't matter if I've died, or my executors and heirs aren't bothered or lack funds.
- I want to sell a business, but being ethical, the future owner must agree that spare parts for my product will be maintained available up to 10 years after product discontinuation. Again, as above, I want to be sure that even if I die and my successors in title don't care, any third party can sue to enforce or for damages, if they breach and past model spares aren't maintained.
I can imagine that it's possible to set up a trust or prepay/pre instruct a law firm so that things can be done under my authority even so. Or that I could build a mechanism into my will, or a living will, in some way, if the concern is death or incapacity. The problems with these approaches are that, nobody else can enforce those if my representatives can't/won't, and nobody else can claim a right to be involved in the legal decision how my representatives conduct a case (if they do), what they agree to, or how they enforce it.
So I'm looking for solutions that directly within the contract wording itself, extend the ability to sue the contracting party for breach, to anyone in the world in some class (or indeed any person in the world if that's the class), even if they weren't a party to the contract and even if they have never themselves explicitly entered a legal relationship with the contracting party.