The Prophet ﷺ passed by a piece of land belonging to one of the Ansar, knowing that the man was in need. He asked, "Whose land is this?"The man replied, "It belongs to so-and-so. He gave it to me to work in exchange for rent."The Prophet ﷺ said, "It would have been better had he granted it to his brother as a gift."Rafi then came to the Ansar and said, "The Messenger of Allah ﷺ has forbidden you from a practice that was beneficial to you, but obedience to the Messenger of Allah ﷺ is more beneficial for you."
أخبرنا أحمد بن سليمان عن عبيد الله قال حدثنا إسرائيل عن إبراهيم بن مهاجر عن مجاهد
مر النبي ﷺ على أرض رجل من الأنصار قد عرف أنه محتاج فقال لمن هذه الأرض قال لفلان أعطانيها بالأجر فقال لو منحها أخاه فأتى رافع الأنصار فقال إن رسول الله ﷺ نهاكم عن أمر كان لكم نافعا وطاعة رسول الله ﷺ أنفع لكم
No references are available.
[Sahih] See the previous hadith. It is in Al-Kubra, no. 4596.