A group of police officers have lost a legal bid to stop disciplinary procedures over claims they shared offensive content on WhatsApp.
The 10 officers said their right to privacy was being compromised after superiors said they would be reprimanded over the messages.
One of the messages was alleged to have contained anti-Semitic content.
Judge Lord Bannatyne ruled in favour of employers Police Scotland at the Court of Session.
The officers' legal team had argued that using the private messages against them amounted to a breach of article eight of the European Convention on Human Rights.
'Decline in public confidence'
However, Lord Bannatyne wrote in his ruling that the "principal purpose" of the police was the protection of the public.
He refused to grant the orders being sought by the officers, who cannot be identified for legal reasons, and said that Police Scotland was entitled to launch disciplinary proceedings.
He said: "Officers behaving in the way set out in these messages may have contravened the standards.
"An officer who fails to meet these standards, for the reasons put forward in the present case on the basis of the messages, can reasonably inferred to be likely to be someone who would lose the confidence of the public and cause a decline in the general public confidence in the police."
Much of the content of the messages remains unknown and Lord Bannatyne did not discuss the exact content in his ruling.
However, at an earlier hearing the court heard one of the groups frequented by the officers on the social media platform was called Quality Polis.
The messages in the private group chat came to light as part of an investigation into a fellow officer over alleged sex offences.
The officer was cleared of any wrongdoing, but detectives passed on the messages to colleagues working for the force's professional standards team.
Lord Bannatyne concluded that as police officers, the group had a different right to privacy than an ordinary member of the public.
He wrote: "I consider the argument comes to this: given the standards and the regulatory framework to which a police officer is subject, then he or she is in a different category from an ordinary member of the public and that is because of their position as police officers their reasonable expectation of privacy is different from an ordinary member of the general public."