a man looked through a hole in the door of the Prophet, who had with him a kind of comb with which he was scratching his head, When the Messenger of Allah saw him he said: "If I had known that you were watching me, I would have stabbed you in the eye with this. This rule of asking permission has been ordained so that one may not look unlawfully (into people's houses). (Using translation from Nasāʾī 4859)
أَنَّ رَجُلًا اطَّلَعَ فِي جُحْرٍ فِي بَابِ رَسُولِ اللهِ ﷺ وَرَسُولُ اللهِ ﷺ يَحُكُّ رَأْسَهُ بِمِدْرًى فَقَالَ رَسُولُ اللهِ ﷺ «لَوْ عَلِمْتُ أَنَّكَ تَنْتَظِرُنِي لَطَعَنْتُ بِهِ فِي عَيْنِكَ إِنَّمَا جُعِلَ الِاسْتِئْذَانُ مِنْ أَجْلِ الْبَصَرِ»