It is unlawful to refuse you employment on the grounds of your sex, either directly, or indirectly by putting in place requirements which would be more difficult for you to comply with than a member of the opposite sex.
The only exception to this protection is where there is some reason connected with the job itself, or circumstances where there in a genuine need to appoint a person of one particular sex. This is known as a Genuine Occupational Qualification (GOQ) and applies in a number of specified circumstances such as
Just One More Click: Doggy drama about staying safe online at work.