[Machine] On the authority of the Prophet ﷺ who said: "The pen has been lifted for three: the sleeper until he wakes up, the child until he reaches maturity, and the insane person until he regains sanity." This narration has been reported to us through various chains of transmission from Ali. And Al-Shafi'i, may Allah have mercy on him, used the hadith of Ibn Umar as evidence in regards to permission during battles, and this has already passed.
عَنِ النَّبِيِّ ﷺ قَالَ رُفِعَ الْقَلَمُ عَنْ ثَلَاثَةٍ عَنِ النَّائِمِ حَتَّى يَسْتَيْقِظَ وَعَنِ الصَّبِيِّ حَتَّى يَحْتَلِمَ وَعَنِ الْمَجْنُونِ حَتَّى يَعْقِلَ وَرُوِّينَاهُ مِنْ أَوْجُهٍ عَنْ عَلِيٍّ ؓ وَاحْتَجَّ الشَّافِعِيُّ رَحِمَهُ اللهُ بِحَدِيثِ ابْنِ عُمَرَ ؓ فِي الْإِجَازَةِ فِي الْقِتَالِ وَقَدْ مَضَى