Employers in Massachusetts now have to provide “reasonable accommodation” for workers who use medical marijuana to treat an illness when not on the job, according to the latest ruling from the state’s Supreme Judicial Court.

The court ruled in favor of Cristina Barbuto, who was hired in an entry-level position at Advantage Sales & Marketing and subsequently fired. Barbuto was initially asked to take a drug test and disclosed that she would test positive for her offsite use of physician-prescribed marijuana to ease the symptoms of Crohn’s disease. She was tested, offered the job, and terminated after one day of work. Her employer’s position was that it would have been “facially unreasonable” to accommodate Barbuto’s use, because marijuana is a Scheduled I Controlled Substance under federal law.

Now they and other employers in the state must permit the offsite use of medical marijuana, unless they can prove it’s causing an undue hardship to the business. In 2015, the Colorado Supreme Court took the opposing stance and ruled in favor of the employer firing a worker for offsite use of medical marijuana.