(13) بَابُ مَا جَاءَ فِي اجْتِهَادِ الْقُضَاةِ بِمَا أَنْزَلَ اللَّهُ تَعَالَى
Narrated `Abdullah:
Allah's Messenger (ﷺ) said, "Do not wish to be like anybody except in two cases: The case of a man whom Allah has given wealth and he spends it in the right way, and that of a man whom Allah has given religious wisdom (i.e., Qur'an and Sunna) and he gives his verdicts according to it and teaches it." (to others i.e., religious knowledge of Qur'an and Sunna (Prophet's Traditions)). "
Reference: Sahih al-Bukhari 7316
In-book reference: Book 96, Hadith 47
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 9, Book 92, Hadith 419