diff --git a/scipost_django/pins/views.py b/scipost_django/pins/views.py index ebc7e54eb315c6d1db0066542eaed3a0a7903928..1f56bd61c4fbe9e12656e0ba862da6d51452e38d 100644 --- a/scipost_django/pins/views.py +++ b/scipost_django/pins/views.py @@ -69,10 +69,8 @@ def _hx_notes_list(request, regarding_content_type, regarding_object_id): # Handle permission checks for viewing and creating notes can_create_notes = request.user.has_perm("pins.can_add_notes") - # Filter non-author users from viewing private notes - notes = notes.exclude( - Q(visibility=Note.VISIBILITY_PRIVATE) & ~Q(author=request.user.contributor) - ) + # Filter according to the visibility of the notes + notes = notes.visible_to(request.user, object) # Filter out internal notes unless the user has the default "manager" # permission for the given object, e.g. "can_manage_subsidies"