An investigation into an Ottawa federal scientist who wrote and performed an anti-Harper protest song and posted it to YouTube has sparked a debate about just how political Canada's public servants are allowed to be.

Tony Turner, a scientist in habitat planning at Environment Canada, was sent home on leave with pay pending a government investigation into the making of Harperman, a highly critical song about Conservative Leader Stephen Harper that has amassed more than 280,000 hits since June.

At issue is whether Turner violated the code of ethics that all public servants must adhere to — one that mandates they be impartial and non-partisan.

At the same time, the courts have upheld public servants' right to engage in political activity.

So how should public servants strike the balance between what's forbidden under the code and permitted by the courts?

"These are very old debates and very old discussions," said Robert Shepherd, a professor at the Carleton University School of Public Policy and Administration. "This is a major question, and it's still being tested."

What is the code?

All federal public servants, some 400,000 people, are bound by the Values and Ethics Code for the Public Sector, which states that a "professional and non-partisan federal public sector is integral to our democracy."

It states that all public servants are expected to carry out their duties "in a non-partisan and impartial manner" and that they must "loyally" serve their departmental ministers.

A non-partisan public service is "an important cornerstone of Canadian democracy," said Stephen Maguire, executive director of the Centre on Values and Ethics at Carleton University.

"We elect the government of the day and we expect that government to carry out the promises that it made during the election, and it can't do that if its policy and the implementation of that policy is actively subverted by the public service."

Supreme Court ruling sparks change

The idea of a non-partisan public service took a hit in 1991 when the Supreme Court upheld public servants' rights to engage in political activities.

Loyalty to the government of Canada and the services we perform on behalf on Canadians does not extend to a blind loyalty to one politician's positions. - Debi Daviau , president of the Professional Institute of the Public Service of Canada

The court ruled that banning political activity infringes on workers' Charter rights to freedom of expression.

Public servants can now volunteer for election campaigns, post political lawn signs, make phone calls and deliver flyers — so long as they don't use office resources and their activities don't impede their ability to do their jobs.

"When we look at this individual case of an Environment Canada scientist who studies migratory birds, it's quite difficult to make the link between the work he does and any impact that video might have on his ability to do his work," said Debi Daviau, president of the Professional Institute of the Public Service of Canada, the union that represents public servants.

"If there's anyone who's guilty of getting in the way of our members doing their jobs impartially, it's the Harper government and their policies."

Debi Daviau, with the Professional Institute of the Public Service of Canada, says civil servants have a right to express themselves politically. (CBC)

She said political activity doesn't jeopardize Canada's tradition of a non-partisan public service.

"A non-partisan public service is exactly what we are and we have a duty of loyalty to the government of Canada that we uphold in the highest regard," she said.

"Nonetheless, that loyalty to the government of Canada and the services we perform on behalf on Canadians does not extend to a blind loyalty to one politician's positions."

'You can't be half-pregnant'

Donald Savoie, the Canada Research Chair in public administration and governance at the University of Moncton, disagrees.

"In my view, regardless of what the Supreme Court might say, public servants should not become political actors, especially in the middle of campaigns," he said. "They are not political actors. We have political actors; they are politicians."

Prof. Donald Savoie says Canada's civil servants should remain non-partisan.

He said you can't be politically active and non-partisan at the same time.

"If you start handing out flyers and you appear in videos, you become a part of that — you become partisan. You can't be half-pregnant," he said.

Public servants run for office

Public servants can run for political office, so long as they get permission from the Public Service Commission and take a leave of absence. A record number of 35 are running in the 2015 federal election.

Still, many public servants remain unclear as to what is acceptable political behaviour.

Chris Rodgers, the Liberal candidate in the Ottawa riding of Carleton who took leave from his job as a policy analyst at Public Safety Canada to run, says he meets public servants who are afraid to get politically involved.

"They don't feel they can put a sign on their yard. They're concerned whether they can go and knock on some doors in the evening," Rodgers told CBC News. "These are people who can and should be able to separate their private political activities from their professional work."

Chris Rodgers is running for the Liberal Party in the newly mapped Ottawa riding of Carleton after taking a leave of absence from his job at Public Safety Canada. (Julie Ireton/CBC)

'Truth to power'

Maguire said public servants also have a responsibility to "speak truth to power."

"If they think there are problems with a government policy, it's their job to point it out," he said. "In this government, speaking truth to power has not been encouraged, to put it mildly."

Daviau agrees, and says the Turner investigation is just the latest example of the government muzzling federal scientists.

But Shepherd says the responsibility to speak truth to power does not give public servants permission to engage in political activism.

"The expression or the vehicle for doing that is to use internal avenues, not to be activists outside of the established mechanisms within the public service," he said.

A public servant concerned about government policy who exhausts all other avenues and chooses to go public, he says, must be willing to accept the consequences.