A California court has ruled that prison inmates are legally allowed to possess marijuana, but that they are not permitted to use it.

Last week , the Third District Court of Appeal in Sacramento overturned the convictions of five inmates who were found with pot, pointing to the language of Proposition 64 , the 2016 ballot initiative that made possession of less than one ounce of marijuana no longer a felony in the state.

“The purpose of the language is to describe the vast array of means of consumption, and consumption, not possession, is the act the voters determined should remain criminalized if the user is in prison,” said the ruling, which was handed down on Tuesday. “We agree with defendants that consumption can be achieved in ways not strictly involving smoking or ingesting, such as inhaled as a nonburning vapor or applied topically such that it is absorbed through the skin.”

However, the court pointed out that smoking or ingesting marijuana remained a felony.

The ruling added that prison authorities reserved the right to ban possession to “maintain order and safety in the prisons.”