For example it is not against the law to employ a male actor for a male part in a play or a woman to clean female toilets while women are likely to be using them or a person of a particular ethnic group to provide welfare services for that ethnic group. It is also against the law for a person to be harassed because of their relationship to or association with a person of a particular sex, race, marital status etc. Sexual harassment is also against the law. Usually harassment is ongoing or a series of events. However, legally just one act can constitute harassment.
Harassment can take many forms.
A relationship or behaviour that is freely accepted by everyone involved is not harassment. If people are in doubt about whether a particular behaviour is acceptable, they should ask the person whether it is. If they are told to stop they should do so immediately and apologise. In general, it is against the law for an employer to act in a discriminatory way. In some situations, individual employees can be held responsible, for example, an employee who sexually harasses another employee.