Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates that the Prophet (peace and blessings be upon him) said: "I have a right over you, and the rulers also have a right over you, as long as they uphold three things: when mercy is sought from them, they show mercy; when they judge, they act justly; and when they make a covenant, they fulfil it. Whoever of them does not do so, upon him is the curse of Allah, the angels and all mankind. No voluntary or obligatory act of worship will be accepted from such people."
Al-Tabarani recorded it in al-Mu'jam al-Awsat. Its chain contains a group of narrators whom I do not know.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الخلافة / 9088
Hadith Gradingمحدثین:إسنادہ ضعیف
Hadith Takhrij«أخرجه المعجم الأوسط للطبراني برقم: 2118»