Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:21751And ʾNbʾ Ibn al-Mubārak > ʿAmmār b. Ruzayq > al-Mughīrah > Saʾalt Ibrāhīm

[Machine] About a man who died and left behind some written documents. The heirs declared the documents as their own due to their inheritance. To whom does the loyalty belong? He said to the deceased writer.  

البيهقي:٢١٧٥١قَالَ وَأنبأ ابْنُ الْمُبَارَكِ أنبأ عَمَّارُ بْنُ رُزَيْقٍ عَنِ الْمُغِيرَةِ قَالَ سَأَلْتُ إِبْرَاهِيمَ

عَنْ رَجُلٍ تُوُفِّيَ وَتَرَكَ مُكَاتَبًا فَأَعْتَقَ الْوَرَثَةُ الْمُكَاتَبَ بِمَا يُصِيبُهُ مِنَ الْمِيرَاثِ لِمَنِ الْوَلَاءُ؟ قَالَ لِلْمُكَاتَبِ الْمَيِّتِ