FIX: should not be allowed to see users list of people who started a PM

This commit is contained in:
Sam 2016-10-19 17:36:35 +11:00
parent 4aedd839bc
commit 674264726d
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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