diff --git a/lib/guardian/post_guardian.rb b/lib/guardian/post_guardian.rb index 6233cb96699..6dc74106d92 100644 --- a/lib/guardian/post_guardian.rb +++ b/lib/guardian/post_guardian.rb @@ -55,7 +55,10 @@ module PostGuardian return false unless topic type_symbol = PostActionType.types[post_action_type_id] + return false if type_symbol == :bookmark + return false if type_symbol == :notify_user && !is_moderator? + return can_see_flags?(topic) if PostActionType.is_flag?(type_symbol) if type_symbol == :vote diff --git a/spec/components/guardian_spec.rb b/spec/components/guardian_spec.rb index ff43ead544f..c5e637f189a 100644 --- a/spec/components/guardian_spec.rb +++ b/spec/components/guardian_spec.rb @@ -248,6 +248,9 @@ describe Guardian do expect(guardian.can_see_post_actors?(topic, PostActionType.types[:off_topic])).to be_falsey expect(guardian.can_see_post_actors?(topic, PostActionType.types[:spam])).to be_falsey expect(guardian.can_see_post_actors?(topic, PostActionType.types[:vote])).to be_truthy + expect(guardian.can_see_post_actors?(topic, PostActionType.types[:notify_user])).to be_falsey + + expect(Guardian.new(moderator).can_see_post_actors?(topic, PostActionType.types[:notify_user])).to be_truthy end it 'returns false for private votes' do