TURNERS FALLS, Mass. — It seemed like the perfect setting for a shy, thoughtful 10-year-old boy’s first steps on stage: a kids’ Shakespeare program that doesn’t hold auditions, guarantees everyone a substantial speaking role, emphasizes community, and excludes no one.

Unless, as Mason Wicks-Lim and his mother Ali discovered, you have a life-threatening nut allergy.

The conflict that ensued over how the theater could accommodate Mason’s allergy eventually grew into a legal battle that created a rift in the community, highlighting the social struggles that people with food allergies often contend with, even as they fight for equal access.

The turmoil began when the family tried to enroll Mason, now 14, in Young Shakespeare Players-East, a revered institution in this small historic town that takes pride in its arts community and progressive activism. The theater’s director, Suzanne Rubinstein, at first rebuffed efforts to register Mason, citing concerns that no one on staff could be trained to administer an EpiPen, a shot of epinephrine used to treat severe allergic reactions. Then, following months of negotiations, she threatened to close the program if he joined.

As word got around that Mason was not welcome, some of his peers in the program urged Ms. Rubinstein to reconsider. Sam Picone-Louro, who was then 12 and had played a soldier and a senator in the spring production of “Julius Caesar,” accused Ms. Rubinstein of discrimination.