Employees in Washington state can be fired if they fail a drug test, even if they have a medical-marijuana authorization from a physician, the state’s Supreme Court has ruled.

The case involved a woman who failed a pre-employment drug test for a firm that handles customer service for Sprint. The woman, who had a valid medical-marijuana authorization from a doctor, sued. The Seattle Times reports that the company said its contract with Sprint mandated drug testing and did not make any exceptions for medical marijuana.

In a 8-1 vote, the court ruled that state law allows employers to prohibit medical marijuana use on the job, but does not address its use outside of work. The majority opinion said that because medical marijuana use is illegal under federal law, the state’s Human Rights Commission, which looks into cases of employee discrimination, cannot pursue claims related to medical-marijuana use.

In a dissenting opinion, Justice Tom Chambers wrote that when Washington state voters passed a medical-marijuana law in 1998, their intent was to protect patients prescribed marijuana for medical purposes. He added that the court’s decision will discourage people from seeking legal medical-marijuana treatment out of concern they could lose their jobs.