BOSTON — A new law gives people with medical conditions access to employee-only bathrooms at Massachusetts businesses if no public restrooms are available.

Gov. Deval Patrick this week signed the so-called restroom access bill. Massachusetts joins a dozen other states with similar laws.

The law’s supporters say people with inflammatory bowel diseases need immediate access to a bathroom.

Only people with a doctor’s note will be allowed access to employee-only facilities under the law.

The law requires only businesses with three or more employees to give people access to their facilities.

About 30,000 Massachusetts residents suffer from inflammatory bowel diseases.