Abdullah bin Nujayy says that Sayyiduna Ali (may Allah be pleased with him) said to me: I had a set time near the pre-dawn hour when I would come into the presence of the Messenger of Allah (peace and blessings be upon him). If the Messenger of Allah (peace and blessings be upon him) was in prayer, he would say 'Subhan Allah' (Glory be to Allah), and that was his (peace and blessings be upon him) permission to me; and if he was not praying, he would grant me permission. Then he mentioned the rest of the hadith.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3339