One of the startling aspects of the decision by Sheriff Kathryn Mackie to pursue two social workers for contempt of court was that she targeted the individuals, not the council which employed them.

When Carol McCulloch chose to disregard Sheriff Mackie's decision that a mother should have contact with her two young boys who were in care, she and her line manager Gillian Lawrence, who authorised it, were doing so with Edinburgh City Council's authority.

The chilling effect the guilty verdict - now overturned by the court of session - had on the social work profession was partly due to this choice. There were reasonable questions to answer, but many people felt the council, not the frontline workers should answer them.

Questions include: Why did social workers decide to end contact again? Should they have gone back to the courts at this point? Should a children's hearing have been held sooner?

Sheriff Mackie's original order for contact overturned a decision by the children's panel - whose responsibility it is to take such decisions on contact, in the best interests of the child.

The social worker initially abided by the order. But Ms McCulloch decided - because foster carers reported the distress contact was causing the children was insufferable - that it should not continue. This included night terrors, bed wetting, hitting, and behavioural concerns.

There is an issue of public concern here which one can only assume Sheriff Mackie was partly responding to. This is the idea that social workers can sometimes be a law unto themselves, appearing to make life-affecting decisions in a fairly unaccountable way.

This bogeyman image of social workers was quashed by Lord Carloway. It is evident, he said, that the social workers acted in what they considered the best interests of the children and intended to have the issue considered by a fresh children's hearing at the earliest opportunity.

It has also been widely muttered that Sheriff Mackie was in some way biased against social work. Lord Carloway says this was not so. However the sheriff was reproached for overreaching her legal role.

Sheriffs can act immediately over contempt if they see it in front of them - if a witness is evasive, or drunk or an accused is abusive - but should not instigate contempt proceedings when there is no 'live process' in front of them, he said.

Lord Malcolm was less forgiving, finding Sheriff Mackie's apparent dismissal of the concerns about the boys' distress bemusing. If she didn't believe the social workers' motives were genuine, he says, Sheriff Mackie should have given some indication of what their true motivation might have been.

The judgement amounted to a strong defence of social workers' responsibility for taking difficult decisions. The critical delay in reviewing contact at a children's hearing was caused partly by the right of the father of the boys to have time to read the papers about their case.

The case raises questions about the rights of parents, particularly the position of the mother, whose route to challenging the social work decision was not straightforward. But social workers took the decision that the child's needs are paramount. That principle is the law, and the law is clear.