A B.C. Supreme Court judge has struck down a section of Canada's medical marijuana laws that said licensed users cannot possess pot cookies or marijuana body creams.

Justice Robert Johnston ruled the federal medical marijuana access regulation that allows permitted users to only possess dried marijuana is unconstitutional on Friday in Victoria.

The court challenge stems from the case of Owen Smith, who was charged with trafficking for baking pot cookies and producing topical cannabis creams for a medical marijuana club in Victoria in 2009.

Health Canada allows people suffering from debilitating illnesses to have access to marijuana for medical purposes. They can get the marijuana through Health Canada or they can get permission to grow it themselves.

But Smith's lawyer Kirk Tousaw successfully argued there is a contradiction in the law, which allows the designated users to smoke marijuana but prohibits them from turning it into any other product.

However, Justice Johnston also ruled even though Smith's constitutional rights were breached by the regulation, he will still have to stand trial for trafficking because he may have been producing the products for people who weren't permitted users.