Don't allow loading tagged PMs in another user's inbox.

This commit is contained in:
Gary
2024-12-12 14:13:05 +11:00
committed by Roman Rizzi
parent 3d47a1268c
commit d2de58e760
2 changed files with 11 additions and 0 deletions

View File

@ -144,6 +144,16 @@ RSpec.describe TagsController do
expect(serialized_tag["count"]).to eq(0)
expect(serialized_tag["pm_count"]).to eq(1)
end
it "doesn't allow users to see other users' PMs" do
non_admin_user = Fabricate(:trust_level_1)
SiteSetting.pm_tags_allowed_for_groups = "1|2|3|11"
sign_in(non_admin_user)
get "/u/#{admin.username}/messages/tags/#{test_tag.name}.json"
expect(response.status).to eq(404)
end
end
context "when disabled" do