An RBC report warns that Canadian oilsands producers face rising discounts for their products exported to the United States as growing production fills pipelines to capacity. An oil worker holds raw sand bitumen near Fort McMurray, on July 9, 2008. THE CANADIAN PRESS/Jeff McIntosh

A court has ruled that British Columbia cannot restrict oil shipments through its borders in a decision that marks a win for the Trans Mountain pipeline expansion and Alberta’s efforts to get its resources to overseas markets.

The province filed a constitutional reference question to the B.C. Court of Appeal that asked whether it had the authority to create a permitting regime for companies that wished to increase their flow of diluted bitumen.

A five-judge panel agreed unanimously that the amendments to B.C.’s Environmental Management Act were not constitutional because they would interfere with the federal government’s exclusive jurisdiction over interprovincial pipelines.

Justice Mary Newbury wrote on behalf of the panel that the substance of the proposed amendments were to place conditions on and, if necessary, prohibit the movement of heavy oil through a federal undertaking.

Newbury also wrote that the legislation is not just an environmental law of “general application,” but is targeted at one substance, heavy oil, in one interprovincial pipeline: the Trans Mountain expansion project.

“Immediately upon coming into force, it would prohibit the operation of the expanded Trans Mountain pipeline in the province until such time as a provincially appointed official decided otherwise,” she said.

“This alone threatens to usurp the role of the (National Energy Board), which has made many rulings and imposed many conditions to be complied with by Trans Mountain for the protection of the environment.”

B.C. argued that the proposed amendments were meant to protect its environment from a hazardous substance, while the federal government and Alberta said the goal was to block Trans Mountain.

Newbury wrote that even if the legislation was not intended to single out the expansion project, it has the potential to affect — and indeed “stop in its tracks” — the entire operation of Trans Mountain as a carrier and exporter of oil.

She said the National Energy Board is the body entrusted with regulating the flow of energy resources across Canada to export markets, and it has already imposed many conditions on Trans Mountain.

She added that the expansion is not just a British Columbia project because it affects the whole country.

The proposed amendments would have meant that Trans Mountain Corp., and any other company wishing to increase the amount of heavy oil it transported through B.C., would have had to apply for a “hazardous substance permit.”

The permit application would have had to detail the risks to human health and the environment from a spill, plans to mitigate those risks and financial measures, including insurance, that ensured payment of cleanup costs.

A provincial public servant would have had the authority to impose conditions on a hazardous substance permit and cancel or suspend the permit if the company did not comply.

B.C. announced the legislative amendments in January 2018, sparking a trade war with then-Alberta Premier Rachel Notley, who retaliated with a ban on B.C. wines in her province.

Premier John Horgan eased the tension by promising to file a reference case asking the Appeal Court whether the amendments were constitutional, prompting Notley to suspend the wine ban in February 2018.

Prime Minister Justin Trudeau’s government has purchased the Trans Mountain pipeline and expansion project for $4.5 billion. Construction was paused last August after the Federal Court of Appeal overturned the federal permits.

The project would triple the pipeline’s capacity to carry diluted bitumen from the Edmonton area to Metro Vancouver, and increase the number of tankers in Burrard Inlet seven-fold.