IT has been reassuring – and gratifying – to see the UK Government held to account in the Supreme Court this week over the Brexit process.

From day one, the Government’s position on how we are to leave the EU has been arrogant and unconstitutional – first, there was the rejection of a vote at Westminster on the triggering of Article 50. Then ministers ruled out a vote in Holyrood and appeared to do the same on any special arrangements for Scotland. Ministers keep saying they are respecting the will of the British people, but their handling of Brexit so far has demonstrated a disdain for parliamentary process as well as the political realities of the UK.

Now, three days into the Supreme Court hearing, the Lord Advocate, James Wolffe, is having his say thanks to a ruling that the Scottish Government should be allowed to intervene. This was a sensible and welcome decision and a reminder that the UK’s departure from the EU cannot be steamrollered through without Scottish, Welsh and other concerns being fully heard. The involvement of the Scottish Government also raises the possibility – albeit a slim one – that Holyrood will be allowed a vote that could stop Brexit in its tracks.

Pretty much no one is expecting that to happen, with the Lord Advocate himself accepting in his presentation that the Scottish Government does not, in law, have a veto on Brexit. However, the Scottish Government’s case so far – he continues speaking today – raises important wider points about the process of Brexit and how the UK Government is handling it.

The most important is that, as the Lord Advocate pointed out, the UK Government’s claim that it can use its royal prerogative powers to trigger Brexit is unconstitutional. The High Court ruled that the rights given to UK citizens by parliament in the European Communities Act 1972 cannot be taken away by the government and the Supreme Court is expected to take the same view. That will mean that the UK Government will be forced to do what it should have done from the beginning: consult MPs on the most important decision the country has made for generations.

However, the Lord Advocate also said that if Westminster was trying to change Holyrood’s powers in the way that Brexit will, MSPs would have to have a vote – and he has argued too that the consent of the Scottish Parliament should be sought because the UK’s withdrawal from the EU will affect areas that are devolved.

That is an argument the Scottish Government is likely to lose, but the UK Government must not interpret that as permission to ignore Scottish concerns. In recent days, Theresa May has been talking about a red, white and blue Brexit, but Scotland voted to stay in the EU and that must mean that its voice is heard in the Brexit process.

It also means that the UK Government has to explore with Scotland’s leaders all of the possible alternatives that would give Scotland bespoke options and protect its specific interests, in the area of immigration for example. The Supreme Court ruling when it comes is likely to mean that a vote at Westminster will be held, but there is a lesson the UK Government should take from the court case: Scotland’s voice must be heard.