Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ahmad:899ʿAlī b. Isḥāq > ʿAbdullāh > Yaḥyá b. Ayyūb > ʿUbaydullāh b. Zaḥr > ʿAlī b. Yazīd > al-Qāsim > Abū Umāmah > ʿAlī b. Abū Ṭālib

If I found him praying, he would say tasbeeh and I would enter, and if he was not praying, he would give me permission to enter.  

أحمد:٨٩٩حَدَّثَنَا عَلِيُّ بْنُ إِسْحَاقَ أَخْبَرَنَا عَبْدُ اللهِ أَخْبَرَنَا يَحْيَى بْنُ أَيُّوبَ عَنْ عُبَيْدِ اللهِ بْنِ زَحْرٍ عَنْ عَلِيِّ بْنِ يَزِيدَ عَنْ الْقَاسِمِ عَنْ أَبِي أُمَامَةَ أَنَّ عَلِيَّ بْنَ أَبِي طَالِبٍ

أَخْبَرَهُ أَنَّهُ كَانَ يَأْتِي النَّبِيَّ ﷺ قَالَ فَكُنْتُ إِذَا وَجَدْتُهُ يُصَلِّي سَبَّحَ فَدَخَلْتُ وَإِذَا لَمْ يَكُنْ يُصَلِّي أَذِنَ