FIX: Account for moderators in group to TL mapping (#25326)

If configuring only moderators in a group based access setting, the mapping to the old setting wouldn't work correctly, because the case was unaccounted for.

This PR accounts for moderators group when doing the mapping.
This commit is contained in:
Ted Johansson
2024-01-19 11:10:28 +08:00
committed by GitHub
parent 561851b104
commit 46f1c209be
3 changed files with 11 additions and 2 deletions

View File

@ -152,6 +152,11 @@ RSpec.xdescribe SiteSettings::DeprecatedSettings do
)
end
it "returns moderator if there is only the moderators auto group in the new group setting" do
SiteSetting.invite_allowed_groups = "#{Group::AUTO_GROUPS[:moderators]}"
expect(SiteSetting.min_trust_level_to_allow_invite_tl_and_staff).to eq("moderator")
end
it "returns staff if there are staff and admin auto groups in the new group setting" do
SiteSetting.invite_allowed_groups =
"#{Group::AUTO_GROUPS[:admins]}|#{Group::AUTO_GROUPS[:staff]}"