it permissible; once al-Khidr explained them to him, Moses assented. Scuttling the boat and then patching it up so its owners would keep it out of a tyrant’s reach was an act of kindness to them, and that is lawful. Likewise, repelling an assailant is permissible even if the aggressor is a minor, and if the only way to prevent a child from driving his parents into unbelief is to put him to death, then his execution is warranted.
Ibn ʿAbbās—may Allah be pleased with both of them—said to Najdah al-Ḥarūrī when the latter asked about killing children: “If you know about them what al-Khidr knew about that boy, then kill them; otherwise do not kill them.” Al-Bukhārī transmitted this report.
As for showing kindness to an orphan without compensation and patiently enduring hunger, these are righteous deeds in full accord with Allah’s Law.
If, however, by “the law” one means a judge’s ruling, that ruling may be unjust or just, correct or mistaken. And if by “the law” one intends the opinions of the juristic imams—Abū Ḥanīfah, al-Thawrī, Mālik ibn Anas, al-Awzāʿī, al-Layth ibn Saʿd, al-Shāfiʿī, Aḥmad, Isḥāq, Dāwūd, and others—their statements must be supported by the Book and the Sunnah. When a person lawfully follows one of them, his imitation is acceptable; yet following any single imam is not obligatory upon the entire community in the way that following the Messenger—may Allah bless him and grant him peace—is.