Filter collections in CaseTable based on user access and open access status
This commit is contained in:
+5
-1
@@ -133,7 +133,11 @@ class CaseTable(tables.Table):
|
|||||||
return "No associated cases"
|
return "No associated cases"
|
||||||
|
|
||||||
def render_collections(self, record):
|
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:
|
if collections:
|
||||||
links = [
|
links = [
|
||||||
format_html(
|
format_html(
|
||||||
|
|||||||
Reference in New Issue
Block a user