This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

BERLIN (AP) — The European Union’s top court ruled Thursday that employers may forbid the wearing of visible symbols of religious or political belief, such as headscarves.

But the Luxembourg-based tribunal said in its ruling that courts in the bloc’s 27 member states should weigh up whether the ban corresponded to a “genuine need” on the part of the employer. They must also consider the rights and interests of the employee, including by taking into account national legislation on freedom of religion, it said.

The case was brought before the Court of Justice of the European Union by two women in Germany who chose to wear Islamic headscarves at their workplaces. One works as a special needs carer while the other is a sales assistant and cashier.

Both filed legal complaints before German courts, which in turn referred questions to the EU tribunal.