Prevent moderators from seeing other users bookmarks

This commit is contained in:
João Fernandes 2016-03-20 18:27:28 +00:00
parent 67a5fc39de
commit ffeca8c2d4
1 changed files with 1 additions and 1 deletions

View File

@ -342,11 +342,11 @@ SQL
builder.where("COALESCE(p.post_type, p2.post_type) IN (:visible_post_types)", visible_post_types: visible_post_types)
unless (guardian.user && guardian.user.id == user_id) || guardian.is_staff?
builder.where("a.action_type not in (#{BOOKMARK})")
builder.where("t.visible")
end
unless guardian.can_see_notifications?(User.where(id: user_id).first)
builder.where("a.action_type not in (#{BOOKMARK})")
builder.where('a.action_type <> :pending', pending: UserAction::PENDING)
end