Bosses can fire workers for smoking pot off the job, even if it’s legal under state law, according to Colorado’s highest court. In a unanimous ruling Monday, the Colorado Supreme Court shot down the challenge of a medical marijuana user who lost his job after failing a random drug test.

Brandon Coats, a quadriplegic worker fired by Dish Network in 2010, argued his firing violated state labor laws, since he was consuming state-licensed medical marijuana during nonwork hours. Coats, who was injured in a car accident, says cannabis is the only substance he and his state-licensed physicians know of that helps control his muscle spasms and seizures.

But judges ruled a state statute that blocks employers from firing workers for a number of lawful off-duty activities doesn’t cover pot consumption -- something that remains illegal on the federal level. “Employees who engage in an activity such as medical marijuana use that is permitted by state law but unlawful under federal law are not protected by the statute,” the court wrote.

Critics slammed the ruling for discriminating against medicinal pot users.

“This is a sad day for Colorado medical marijuana patients, who now have no protection for off-duty use of medical or recreational marijuana,” the Cannabis Therapy Institute said in a statement.

The ruling clears up what had been a major ambiguity in state labor law since Colorado voted to legalize medicinal cannabis in 2000. The state voted to legalize recreational marijuana in 2012.

“Although naturally devastating for us, the silver lining of this case ... is that there was previously no clear definition on what an employer and employee could do when it came to [medical marijuana],” said Coats’ lawyer, Michael Evans. “It was a very scary gray area for both sides. All of that hard work and risk put into this case was not a waste, because at least now there is clear communication for everyone on that issue from the court.”

Observers say the case could shape legal precedents as states increasingly roll back restrictions on marijuana use. Medicinal cannabis is legal in 23 states, including, most recently, in Maryland, Minnesota and New York, where legislators approved reforms last year. Two states, Colorado and Washington, allow recreational marijuana.

The federal Americans With Disabilities Act protects most workers with serious medical conditions from discrimination but does not cover medicinal pot users. The absence of clear federal protections -- combined with Monday's court ruling -- underlines the need for state legislators to pass a patients' bill of rights, says Art Way, director of the Colorado office of the Drug Policy Alliance.

Coats’ former employer applauded the ruling in a statement. “Dish is committed to its drug-free workplace policy and compliance with federal law, which does not permit the use of marijuana, even for medicinal purposes.”