Here's why some businesses can deny you service - but others can't

Updated 3:05 AM ET, Sat June 30, 2018

Chat with us in Facebook Messenger. Find out what's happening in the world as it unfolds.

(CNN)A Virginia restaurant's decision not to serve White House press secretary Sarah Sanders raises a major question: Can businesses serving the public legally do that?

The answer is not clear cut. It depends on a number of factors, including whether the business's reasons are political, moral or discriminatory, and the person claiming discrimination falls under a protected trait or class, such as race or religion, lawyers say.
With specific federal law and state laws that vary to certain degrees, it also depends on where the incident happened.
Let's look at some scenarios:
Real life example

White House press secretary Sarah Sanders was refused service by the Red Hen restaurant in Lexington, Virginia, last week. She said it's because she works for the Trump administration. The restaurant's owner said she asked her to leave because she supported some of the President's controversial policies.

What the law says:
Under American law, a business owner has the right to refuse service to some customers. But federal and a lot of state laws say you can't discriminate against customers based on factors such as race, religion, sex or national origin, said Alexandra Brodsky, a civil rights attorney at the National Women's Law Center.
    Turning away Sanders because she's President Trump's press secretary gives the impression that public spaces and public businesses are not open to all, says David Cole, legal director at the American Civil Liberties Union. However, he notes, a business being uncivil or rude isn't illegal.
    In the District of Columbia, there's a list of 20 protected traits that include race, religion, disability and political affiliation.
    If Sanders was refused service in DC, and it was considered a result of her political affiliation, that would have been illegal in the nation's capital. Virginia has a similar list, but it doesn't include political affiliation.

    Real life example

    An Arizona woman says a Walgreens pharmacist refused to fill her prescription that would have ended her pregnancy after the fetus stopped developing, citing personal objections.

    What the law says:
    Arizona is one of six states with a law allowing pharmacists to decline to sell emergency contraceptives on "moral grounds," according to the National Conference of State Legislatures. The other five states are Arkansas, Georgia, Idaho, Mississippi and South Dakota.
    Kansas has a similar law that allows pharmacists to refuse to fill a prescription if he or she "reasonably believes" the medicine could result in an abortion.
    Colorado, Florida, Illinois, Maine and Tennessee have similar refusal clauses that do not specifically mention pharmacists.
    Walgreens says its pharmacists can step away from filling a prescription if the decision is based on a "moral objection." When a pharmacist opts to do that, he or she must refer the prescription to another pharmacist or manager on duty.
      Walgreens has since apologized to the woman, and said it will provide additional training to its staff.

      Real life example:

      In Colorado, a baker refused to make a wedding cake for a same sex-couple six years ago, citing his religious beliefs. What followed was a years-long legal battle that culminated in a US Supreme Court ruling this month in favor of baker Jack Phillips.

      What the law says:
      Like other states, Colorado prohibits businesses open to the public from denying people service based on characteristics such as religion, race and sexual orientation.
      However, under the federal Civil Rights Act of 1964, discrimination in public businesses in the United States is prohibited on the basis of race, color, religion or na