The Arizona Supreme Court ruled last week on two cases that will prohibit prosecutors from denying medical marijuana users the use of marijuana while they are on probation.

The ruling stems from one case involving a man convicted of possessing marijuana for sale in Cochise County, who was forbidden from using marijuana by a probation officer after he was released from prison. The other involves a woman convicted of DUI in Yavapai County who refused to accept the portion of a plea agreement that would deny her marijuana use, resulting in the plea agreement being withdrawn. Both have medical marijuana cards.

The court ruled that such action violates Arizona law, and that neither courts nor prosecutors can ban the use of marijuana as part of a plea agreement.

Under Arizona’s Medical Marijuana Act, last year the state registered a total of 52,374 cardholders, sold 9.4 metric tons of marijuana and gained more than $10 million in tax revenue.