All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The Majma' Al-Fiqh Al-Islami in Makkah (Islamic Fiqh Council) passed a resolution that one may donate his body parts with some conditions. One of those conditions is that one may donate only with his own will without any compulsion provided he is mature and has given permission before he died.
This condition applies to your question.
For more benefit on organ donation and its conditions, please refer to Fataawa 86647, 85514, and 323434.
Allah knows best.