Ibn Mas’ud Allah be pleased with him reporter: The Prophet peace and blessings of Allah be upon him said, “Envy is permitted only in two cases: A man whom Allah gives wealth, and he disposes of rightfully, and aman to whom Allah gives knowledge which he applies and teaches it.”
[ Al-Bukhari and Muslim]