It is narrated from Sayyiduna Samurah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever puts a wall around something, it is his, and the one with an unjust root has no right."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب إحياء الموات / 11778