Abd al-Rahman bin Mahdi (may Allah have mercy on him) said: Knowledge is to be taken from the people of desires (ahl al-ahwa'), and their testimony is permissible, as long as they do not call people to their creed; when they call to their creed, hadiths are not to be written from them, nor is their testimony permissible.
By 'writing knowledge' he meant the reports (akhbar).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 20903