From 9200e9aae5d1b1e62f52d38243a41808eff27fbb Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 29 Jul 2025 10:03:10 +0100 Subject: [PATCH] Filter collections in CaseTable based on user access and open access status --- atlas/tables.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/atlas/tables.py b/atlas/tables.py index e5976728..9d32ca5b 100755 --- a/atlas/tables.py +++ b/atlas/tables.py @@ -133,7 +133,11 @@ class CaseTable(tables.Table): return "No associated cases" def render_collections(self, record): - collections = record.casecollection_set.all() + collections = [ + collection + for collection in record.casecollection_set.all() + if (hasattr(self, 'request') and self.request.user == collection.author) or collection.open_access + ] if collections: links = [ format_html(