LANSING, Mich. – A Michigan prosecutor who used his personal blog to attack the openly gay student body president at the University of Michigan has spurred debate about public employees’ rights to say terrible things on their own time.

Andrew Shirvell, 30, started a blog in April in which he regularly lambasted 21-year-old Christopher Armstrong as a racist with a “radical homosexual agenda.” Shirvell has said that when he’s not at work, he has a right to say whatever he wants.

Cliff Sloan, a First Amendment expert with the New York-based Skadden, Arps, Slate, Meagher & Flom law firm, said public employers must be careful because the First Amendment says government can “make no law abridging the freedom of speech.” Still, judges and state officials have some discretion when comes to dealing with workers, he said.

“While they have a right to free speech, they don’t have a right to a public service job,” said Sloan, the former publisher of Slate magazine. “Government can set some limits on the appropriate conduct and behavior of their employees.”

Where the line is drawn with government jobs seems to vary from state to state. In Kansas, workers involved in controversial protests have kept their jobs, while those in New Jersey and Nebraska have been fired.

Shirvell took a leave from his job as an assistant attorney general Thursday, and John Sellek, a spokesman for Attorney General Mike Cox, has said he could face a disciplinary hearing when he returns. Sellek said he couldn’t say what that hearing might involve, but Cox has said he’s troubled that Shirvell videotaped police breaking up a party at Armstrong’s Ann Arbor home over Labor Day weekend.

Kary Moss, head of the Michigan chapter of the American Civil Liberties Union, said that while Shirvell has a right to speak his mind, “law enforcement can and should get involved” if he has been involved in criminal harassment and stalking.

Armstrong applied Sept. 13 for a personal protection order, claiming Shirvell has followed him around Ann Arbor since April and heckled him during speeches, among other things.

In Kansas, members of Westboro Baptist Church in Topeka are known for picketing soldiers’ funerals. The members claim soldiers’ deaths are punishment for the nation’s tolerance of homosexuality.

The pastor’s daughter, Margie Phelps, is scheduled to present arguments next week to the U.S. Supreme Court that the picketing is speech protected by the U.S. Constitution. When she appears before the high court, she’ll be on leave from her job as director of a state program helping inmates re-enter society. Phelps’ brother, lawyer Fred Phelps Jr., also works for the Kansas Department of Corrections.

In other states, however, workers have been fired for violating ethics codes. New Jersey transit worker Derek Fenton was fired two days after he burned pages from a Quran on Sept. 11 outside the site of a proposed Islamic cultural center, that would include a mosque, near ground zero.

The transit agency said last month that Fenton had violated its code of ethics and “his trust as a state employee.” The legal director for the ACLU’S New Jersey chapter has said the firing may have violated Fenton’s First Amendment rights.

Michigan’s civil service rules specify only that state attorneys can’t take outside work representing people suing the state. But all civil service workers can be disciplined for “conduct unbecoming a state employee,” according to the rules published on the state’s website.

In Nebraska, state trooper Robert Henderson has fought his 2006 firing for joining a group with ties to the Ku Klux Klan. The trooper told an investigator he joined the Knights Party in 2004 to vent his frustrations about his separation from his wife, who left him for a Hispanic man.

An arbitrator overturned his firing, noting Henderson was entitled to his free speech rights. The state appealed the decision, and the matter is now before the state Supreme Court.