It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever is given a gift while people are with him, they are partners in it."
This has also been narrated through another chain from Amr, and there is reservation about it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الهبات / 12036