After a man was recently 'rejected from London flatshare because he is gay', Nigel Mackay examines whether the laws protecting LGBT people are adequate.

What would you think if a black man received the following text message, in response to an enquiry about a flat share opportunity?

Hi, apologies for the late reply. It looks like one flatmate would prefer a white individual. It is terrible, but it is something this person would not negotiate…really sorry, good luck with your search

That this kind of racism has no place in modern society? That it harks back to the dark days of the 60s and 70s when signs reading “No Irish, No blacks, No dogs” were common? And that this must be unlawful?

Most people would surely agree with you, on all counts.

What if it was a gay man who had received the text message, and the word “white” was replaced with the word “straight”? According to newspaper reports, that is exactly what happened this week to Olly Barter after he had responded to an advert on Spareroom.co.uk for a room in Tooting.

Many people would say that LGBT people should be protected from this kind of discrimination in the same way as people from ethnic minorities. Why should an LGBT person be denied housing simply because of his or her sexual orientation or transgender status?

Unfortunately, the law is not as simple as that. It is right that the Equality Act 2010 does not allow property owners or landlords to refuse to sell or rent properties (or tenants to sublet their properties) to people because of their sexual orientation.

However, there are exceptions to this general rule. If it is a private sale, with no estate agent or advertising, then an owner-occupier has more freedom to discriminate, except on grounds of race.

As well as this, there is the “small premises exception”. Depending on the size of the property, the number of people already living there and whether there are shared facilities, current residents may be permitted to discriminate against flat-share applicants. Again, this exception does not apply to race discrimination – presumably for the very reason that it would allow the return of the “No blacks, No Irish” days, which no-one wants to see.

However, it does mean that in some circumstances, someone could be refused a room because they are an LGBT person or, worse, could be asked to leave a flat-share for that reason.

In response to this, some people might say: “it’s my home, I should be able to choose who lives with me”. Of course, people should be free to specify that they would not want a smoker, or someone who wants to hold all night parties or even someone who eats meat, if they would prefer to keep a vegetarian kitchen. There is no problem with expressing that.

But equality law exists to protect minorities and people who have traditionally suffered discrimination. Employers cannot refuse to work with someone simply because they are gay, so why should someone be allowed to refuse to a let a room to a gay person or, indeed, to a Christian or someone with a disability?

You might say that this could mean that women would not be able to specify that they only want to live with other women. That situation is different, for a number of reasons, including that women want to feel safe at home. However, this safety argument cannot reasonably be used to justify discrimination against LGBT people, as much as it cannot be used as a cover for racism.

In fact, for gay people, the opposite may well be true. Mr Barter said that he had mentioned his sexuality in his enquiry for his own protection.

He said:  "Part of the reason I say that I'm gay to start with is for protection in a way, to keep myself out of dodgy situations where someone reveals their bigotry later down the line."

Sadly, at the moment, this may be necessary, as the law may not have protected him if he had been asked to leave his home because of his sexual orientation.