For each transaction / contract, any number of documents is recorded.
Each document has its own set of parties that have the right to view it.
The document is written in encrypted form.
The cipher code of the document is recorded in the data transaction for each user separately in an encrypted form (encrypted with a private key).
Thus, each user will be able to view only those documents for which he has a code. The storage of codes is data transaction.