It's a victory for a Massachusetts man denied employment based on his sexual orientation.

A Massachusetts Superior Court judge ruled Thursday that the all-girls Catholic high school Fontbonne Academy in Milton had violated anti-discrimination laws when it rescinded a 2013 Food Services Director job offer to Matthew Barrett after he listed his husband as his emergency contact.

"What the court focused on was that this person's job has nothing to do with religion. Fontbonne can't simply deem all of their employees to be ministers when their job has nothing to do with religion," GLAD attorney Ben Klein said.

Barrett, a Dorchester resident, told necn earlier this month that the case has been "very emotional."

Through his GLAD attorneys, Barrett said he's "ecstatic" with the ruling.

Earlier this month Barrett said, "It shouldn't have happened to me, it was wrong and it shouldn't happen to anyone else,"

Fontbonne Academy released a brief statement saying, "We have received the court’s decision in this matter and are considering our options."

Barrett's attorney through GLAD Ben Klein says even if this case is appealed all the way up to the Supreme Judicial Court as expected, the judge's detailed 21-page decision leaves little room for interpretation on anti-discrimination laws outweighing an employer's perceived religious exemptions.

"The constitutional issues in this case are very important it's the first time that they've come up in this context and I think the judge's ruling will be very influential throughout the country," Klein said.