mirror of
https://github.com/discourse/discourse.git
synced 2025-06-27 19:11:38 +08:00
UX: Admins should only see their own PMs when searching in:all
Admins are technically allowed to access all PMs, but it can be confusing to include them all in search. Follow-up to e0605029dc58c681e61400042763aa8a43c584c7
This commit is contained in:
@ -828,7 +828,7 @@ class Search
|
||||
end
|
||||
elsif opts[:type_filter] === "all_topics"
|
||||
private_posts = posts.where("topics.archetype = ?", Archetype.private_message)
|
||||
private_posts = private_posts.private_posts_for_user(@guardian.user) unless @guardian.is_admin?
|
||||
private_posts = private_posts.private_posts_for_user(@guardian.user)
|
||||
|
||||
posts = posts.where("topics.archetype <> ?", Archetype.private_message).or(private_posts)
|
||||
else
|
||||
|
Reference in New Issue
Block a user