Medical cannabis patients in Massachusetts could regain access to vaporizers next week after the Cannabis Control Commission decided not to uphold Gov. Charlie Baker’s ban.

Baker decided to impose a four-month prohibition on sales of all vape products in response to a lung illness outbreak that has swept North America. However, Superior Court Judge Douglas Wilkins ruled on Tuesday that Baker does not have the authority to put restrictions on medical marijuana.

The judge said that only the Cannabis Control Commission has the power to prevent medical cannabis patients gaining access to vaping products. Wilkins said that a ban on these products would cause patients irreparable harm, as they rely on them to treat severe pain.

His ruling sparked a massive attendance at the CCC’s monthly meeting, in which the agency’s top regulator indicated he would not enact the ban that Baker was hoping for.

Shaleen Title, commissioner at the CCC, had previously declared that the ban on legal vape cartridge sales would push consumers towards the illicit market. The lung illness, which has resulted in at least 39 deaths and more than 1,800 injuries, has mainly been attributed to illicit vape cartridges sourced on the black market.

Title is concerned that ending sales of legal products, which are regulated and tested, will push cannabis users to dangerous illicit products instead. Vape shops have also sued the Baker administration over the proposed ban.

Judge Wilkins’ ruling states that the ban on vaping products for medical marijuana patients will end on Tuesday, Dec. 12 unless the CCC votes to keep it in place. Commissioners decided not to take that action, and they instead approved a motion to create new medical and recreational marijuana regulations that would allow the CCC to respond to potential changes in the legal landscape.

However, CCC executive director Shawn Collins told the monthly meeting that he is leaning towards a quarantine of all cannabis cartridges until they are tested for consumer safety.

The judge’s order does not affect Baker’s four-month ban on recreational cannabis vapes or e-cigarettes. The Baker administration has appealed Wilkins’ ruling and asked for a temporary stay that would keep the ban in place on vaping marijuana for medical purposes. It argued that this would prevent confusion among patients.