He came to Muawiya and entered upon him and said, "I heard the Messenger of Allah ﷺ say, 'Whoever is put in charge of any of the affairs of the people and then shuts his door against the poor, the wronged, or the one in need, Allah will shut the doors of His mercy against him at the time of his need and poverty when he is most in need of it.'"
حدثنا معاوية بن عمرو وأبو سعيد قالا حدثنا زائدة قال حدثنا السائب بن حبيش الكلاعي
أتى معاوية فدخل عليه فقال سمعت رسول الله ﷺ يقول من ولي أمرا من أمر الناس ثم أغلق بابه دون المسكين والمظلوم أو ذي الحاجة أغلق الله تبارك وتعالى دونه أبواب رحمته عند حاجته وفقره أفقر ما يكون إليها
Its chain of transmission is daif, due to the unknown status of Abu Shatha al-Azdi. Haythami declared him unknown in al-Majma 5/210, though the name was corrupted there to Abu Simah, and he also attributed it to Abu Yaala, where it appears with the same wording and chain in 13/368, number 7378. Husayni likewise declared Abu Shatha unknown in al-Ikmal, as did Ibn Hajar in al-Tajeel. Abu Dawud narrated it from Abu Maryam in 3/130, number 2948, in the book of Kharaj, concerning what is required of the leader regarding the subjects. Tirmidhi narrated it through the route of Amr bin Mura, and said, "He is known by the kunya Abu Maryam," and he described it as gharib. Both versions have similar wording.