Liyakatali Takim, Professor Liyakat Takim is the Sharjah Chair in Global Islam at McMaster University in Canada. Answer imported 2 years ago

Writing of fictions or novels is permitted provided they do not go beyond the bounds of shari'a. So, for example, writing a novel which could clearly lead to lustful thoughts or acts is haram, so is writing any form of material which is insulting to Islam or God, the Prophets, and Imams.