mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
Merge pull request #4098 from JSFernandes/prevent-mods-from-seeing-bookmarks
Fix: Prevent moderators from seeing other users bookmarks
This commit is contained in:
commit
1ab1cb5490
1 changed files with 1 additions and 1 deletions
|
@ -342,11 +342,11 @@ SQL
|
||||||
builder.where("COALESCE(p.post_type, p2.post_type) IN (:visible_post_types)", visible_post_types: visible_post_types)
|
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?
|
unless (guardian.user && guardian.user.id == user_id) || guardian.is_staff?
|
||||||
builder.where("a.action_type not in (#{BOOKMARK})")
|
|
||||||
builder.where("t.visible")
|
builder.where("t.visible")
|
||||||
end
|
end
|
||||||
|
|
||||||
unless guardian.can_see_notifications?(User.where(id: user_id).first)
|
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)
|
builder.where('a.action_type <> :pending', pending: UserAction::PENDING)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue