The Prophet ﷺ said: It is not permissible for a man who believes in Allah and in the Last Day that he should say the prayer while he is feeling the call of nature until he becomes light (by relieving himself). Then the narrator Thawr b. Yazid transmitted a similar tradition with the following wordings: "It is not permissible for a man who believes in Allah and in the Last Day that he should lead the people in prayer but with their permission; and that he should not supplicate to Allah exclusively for himself leaving all others. If he did so, he violated trust." Abu Dawud said: This is a tradition reported by the narrators of Syria; no other person has joined them in relating this tradition.
عَنِ النَّبِيِّ ﷺ قَالَ لاَ يَحِلُّ لِرَجُلٍ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ أَنْ يُصَلِّيَ وَهُوَ حَقِنٌ حَتَّى يَتَخَفَّفَ ثُمَّ سَاقَ نَحْوَهُ عَلَى هَذَا اللَّفْظِ قَالَ وَلاَ يَحِلُّ لِرَجُلٍ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ أَنْ يَؤُمَّ قَوْمًا إِلاَّ بِإِذْنِهِمْ وَلاَ يَخْتَصَّ نَفْسَهُ بِدَعْوَةٍ دُونَهُمْ فَإِنْ فَعَلَ فَقَدْ خَانَهُمْ