BYRON TOWNSHIP, Mich. (AP) — Michigan’s medical marijuana law doesn’t overrule certain zoning powers of local governments, the state Supreme Court said Monday.

Byron Township has an ordinance that bars registered caregivers from growing marijuana at a commercial property. The Michigan appeals court said the ordinance conflicted with the medical marijuana law, which allows cultivation in an “enclosed, locked facility.”

But the Supreme Court, in a unanimous opinion, said the law doesn’t stop local governments from regulating land use as long as officials don’t prohibit or penalize all medical marijuana cultivation.

The court said Byron Township can also require caregivers to obtain a permit and pay a fee before they use a building to grow medical marijuana.