BRUSSELS Companies may ban staff from wearing Islamic headscarves and other visible religious symbols under certain conditions, the European Union's top court ruled on Tuesday, setting off a storm of complaint from rights groups and religious leaders.