What is the oldest written source in this country that mentions this right?
Afghanistan
According to Article two of the 1964 Constitution of Afghanistan: "Islam is the sacred religion of Afghanistan. Religious rites performed by the State shall be according to the provisions of the Hanafi doctrine. Non-Muslim citizens shall be free to perform their rituals within the limits determined by laws for public decency and public peace."
References:
https://www.constituteproject.org/constitution/Afghanistan_1964