Sunan an-Nasa'i, Volume 4, Book 35, Hadith 3900 (DarusSalam)

It was narrated that Rafi' bin Khadij said: "The Prophet passed by the land of a man from among the Ansar who he knew was in need and said: 'Whose is this land?' He said: 'So and so's; he has given it to us in return for rent.' He said: 'Why did he not give it to his brother?'" Rafi' came to the Ansar and said: "The Messenger of Allah has forbidden something for you which was beneficial, but obedience to the command of the Messenger of Allah is more beneficial for you."

أَخْبَرَنَا أَحْمَدُ بْنُ سُلَيْمَانَ، عَنْ عُبَيْدِ اللَّهِ، قَالَ حَدَّثَنَا إِسْرَائِيلُ، عَنْ إِبْرَاهِيمَ بْنِ مُهَاجِرٍ، عَنْ مُجَاهِدٍ، عَنْ رَافِعِ بْنِ خَدِيجٍ، قَالَ مَرَّ النَّبِيُّ صلى الله عليه وسلم عَلَى أَرْضِ رَجُلٍ مِنَ الأَنْصَارِ قَدْ عَرَفَ أَنَّهُ مُحْتَاجٌ فَقَالَ ‏‏"‏‏ لِمَنْ هَذِهِ الأَرْضُ ‏‏"‏‏‏.‏‏ قَالَ لِفُلاَنٍ أَعْطَانِيهَا بِالأَجْرِ‏.‏‏ فَقَالَ ‏‏"‏‏ لَوْ مَنَحَهَا أَخَاهُ ‏‏"‏‏‏.‏‏ فَأَتَى رَافِعٌ الأَنْصَارَ فَقَالَ إِنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم نَهَاكُمْ عَنْ أَمْرٍ كَانَ لَكُمْ نَافِعًا وَطَاعَةُ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنْفَعُ لَكُمْ‏.‏‏

sunnah.com