Should you be allowed to tweet or say anything you want, because free speech is covered by the First Amendment?

ABC sitcom star Roseanne Barr tweeted a racist comment about former White House adviser Valerie Jarrett on Tuesday[1] and was swiftly fired.

Theres a big difference between free speech and hate speech...

— C-Nappz (@CNappz)

But could everyday workers be fired for expressing their opinions at the office?

Here’s what experts say:

What am I allowed to post on Facebook and Twitter?

Employers may decide to take disciplinary action against their employees if they post something on Facebook FB, +0.44%[3]   or Twitter that is inconsistent with their values on social media, said Paula Brantner, a senior adviser at Workplace Fairness, an employment law nonprofit. And that includes big stars like Roseanne.

It’s a particularly tricky issue when workers identify their workplaces on their social media profiles. That might imply that egregious tweets represent the views of the company when they post publicly, she said.

Don’t miss: 5 of the costliest tweets ever[4]

ABC DIS, -2.46%[5]   Entertainment, for instance, called Roseanne’s Twitter comment “abhorrent, repugnant and inconsistent with our values.”

“If you anger the wrong person, there is certainly the possibility of some kind of retaliatory action,” she said. She suggests checking privacy settings to make sure private posts stay private, and carefully considering who to be “friends” with on social media.

Managers could take issue with social media posts and potentially discipline an employee, she said. “Right now, a lot of people are speaking out about things they didn’t speak out about before. Generally in terms of our political debate, that’s a good thing,” Brantner said. “But if you’re doing it at work, there are risks.”

Can I share my political opinions and keep my job?

If you’re a private-sector employee: No.

This issue also came up during protests in Charlottesville, Va.[6], when a man who reportedly attended the white nationalist march lost his job at a hot dog chain in Berkeley, Calif.

The First Amendment guarantees freedom of religion, expression, assembly and the right to petition[7]. The amendment prohibits the government from interfering in the free exercise of speech and religion.

That’s why it may give government employees additional protection, since any action against an employee may be considered government action, said Paula Brantner, a senior adviser at Workplace Fairness, an employment...

Read more from our friends at MarketWatch