diff --git a/taiga/timeline/service.py b/taiga/timeline/service.py index 96567739..1586138d 100644 --- a/taiga/timeline/service.py +++ b/taiga/timeline/service.py @@ -115,6 +115,10 @@ def filter_timeline_for_user(timeline, user): project__anon_permissions__contains=[content_type_key], data_content_type=content_type) + # There is no specific permission for seeing new memberships + membership_content_type = ContentType.objects.get(app_label="projects", model="membership") + tl_filter |= Q(project__is_private=True, data_content_type=membership_content_type) + # Filtering private projects where user is member if not user.is_anonymous(): membership_model = apps.get_model('projects', 'Membership') diff --git a/tests/integration/test_timeline.py b/tests/integration/test_timeline.py index b6743d9f..47583c70 100644 --- a/tests/integration/test_timeline.py +++ b/tests/integration/test_timeline.py @@ -125,7 +125,7 @@ def test_filter_timeline_private_project_member_permissions(): service._add_to_object_timeline(user1, task2, "test") timeline = Timeline.objects.all() timeline = service.filter_timeline_for_user(timeline, user2) - assert timeline.count() == 1 + assert timeline.count() == 3 def test_create_project_timeline():