A former public servant has lost a free speech High Court case over tweets criticising government policies.

The High Court was asked to rule on whether Michaela Banerji’s sacking from what was then the Department of Immigration and Border Protection was lawful.

Ms Banerji was sacked for breaching the Australian Public Service (APS) Code of Conduct, after an internal investigation by the department linked the Twitter profile LaLegale to her.

The account was used to post opinions critical of the Australian Government.

The High Court unanimously ruled that her sacking did not impede her implied right to freedom of political communication, and that the APS code was proportionate to its purpose of maintaining an apolitical public service.

Her lawyer, Allan Anforth, said he the decision may have far-reaching consequences.

“The implications don't stop at the boundary of public servants,” he said.

“The implication is that for any employee-employer relationship, if the employee is critical of the employer's position on some politically relevant social issue, they can be sacked.

“This is a really naive decision in terms of the political realities of what exist in the community.”

APS guidelines state: “An APS employee must take reasonable steps to avoid any conflict of interest (real or apparent) in connection with the employee's APS employment” and also “uphold the integrity and good reputation of the employee's agency and the APS”.

Lawyers argued that Ms Banerji’s sacking was unreasonable because the LaLegale account did not disclose that it was operated or endorsed by a member of the public service, and so was not bringing the APS into disrepute.

In its reasoning, the Court explained that the APS guidelines also explicitly warn staff that they should not expect to be protected by anonymity when posting online.

“There is no reason to suppose that ‘anonymous’ communications cannot fail to uphold the integrity and good reputation of the APS,” the Court said.

APS guidelines say: “As a rule of thumb, anyone who posts material online, particularly on social media websites, should assume that, at some point, his or her identity and the nature of his or her employment will be revealed”.

“The risk of identification which justifies that rule of thumb is obvious, and it is borne out by the facts of this case,” the Court said.

Ms Banerji also lost the right to compensation for PTSD developed in the wake of her firing.

The Community and Public Sector Union (CPSU) says the decision could potentially affect the millions of Australians working in state, local and federal governments.

CPSU national secretary Nadine Flood has described Comcare v Banerji “one of the most important cases on the implied freedom of political communication of recent years”.

“People working in Commonwealth agencies should be allowed normal rights as citizens rather than facing Orwellian censorship because of where they work,” Ms Flood said.

Ms Flood said the harsh line on public servants’ use of social media has become “even more draconian” since the case was launched.

“This is a disappointing decision, but at the end of the day the Government has a responsibility to protect freedom of speech,” she said.

“The Morrison Government needs to demonstrate that it prioritises democratic rights, with a social media policy that reflects the real world.

“The notion that the mum of a gay son who happens to work in Centrelink can't like a Facebook post on marriage equality without endangering her job is patently absurd.

“The Government's overreach on social media has been bad for the public sector and bad for our democracy.”