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
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 other people are with him, they too are partners in that gift."
Ahmad bin Yusuf narrated it from Abd al-Razzaq as a statement of Ibn Abbas (mawquf), not attributed to the Prophet (marfu'), and that is more correct.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الهبات / 12037