As a writer of juvenile fiction, I also of course read juvenile fiction. The latest I read was A Long Way from Home by Newfoundland born Alice Walsh. With some limitations it is a good read, dealing with the Newfoundland response to the many planes downed in that province during 9/11. What is interesting is one of the several lead characters, Rabia, is from Afghanistan. The writing about the difficulties of her life in Aghanistan seems authentic, while the author is clearly not Afghani.
Recently a publisher rejected a manuscript of mine apparently on the basis that I am not of the same ethnic group as one of the characters. I can write about males, even though I am female. I can write about having a medical condition that I do not have. I can write about the past in a time and a place and a circumstance I did not live. Research, and often a great deal, is needed on all counts.
But when and how is it okay to write about an ethnic group, other than my own?