codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
30 stars 26 forks source link

Revoking viewing permissions to a document does not revoke viewing permissions to its entry in the documents list #342

Open timbot1789 opened 1 year ago

timbot1789 commented 1 year ago

Bug Description: If you revoke someone's permission to read a document in your pod, the entry for the document will still appear in the documents table when they view your pod.

This is because we store information on the document in 2 places: the document file itself, and in the documentsList.ttl, which acts as an index of all the documents in your pod and a source of metadata. When a user revokes permission to view the document, it does not revoke permission to view the entry in documentsList.ttl.

Additional Context: We use documentsList.ttl in order to fetch all information necessary to display documents in one request. The documents container maintains an index of all its children, but we can't get document description or expiry date from that. Having separate metadata files for each document will increase load time of the documents table significantly, as we will need to perform a separate network fetch for each row in the table.

Possible Solution (optional): I can think of a few possible approaches: