FIX: should not be allowed to see users list of people who started a PM
This commit is contained in:
parent
4aedd839bc
commit
674264726d
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue