Who can write what about whom?

In the news recently, Anthony Horowitz reveals that his editor has warned him off writing a black character into his next book. As he comments, that would be a pity, because if he only wrote characters that he represented himself, he would be restricted to 62 year-old white, male, Jewish men living in London!