DEV: Convert min_trust_to_edit_wiki_post to groups (#24766)

This change converts the min_trust_to_edit_wiki_post site setting to edit_wiki_post_allowed_groups.

See: https://meta.discourse.org/t/283408

Hides the old setting
Adds the new site setting
Add a deprecation warning
Updates to use the new setting
Adds a migration to fill in the new setting if the old setting was changed
Adds an entry to the site_setting.keywords section
Updates tests to account for the new change
After a couple of months, we will remove the email_in_min_trust setting entirely.

Internal ref: /t/117248
This commit is contained in:
Krzysztof Kotlarek
2023-12-12 15:20:37 +11:00
committed by GitHub
parent 5140caf0e4
commit 7dd150bc95
11 changed files with 54 additions and 20 deletions

View File

@@ -1877,7 +1877,7 @@ RSpec.describe TopicsController do
end
it "can add a tag to wiki topic" do
SiteSetting.min_trust_to_edit_wiki_post = 2
SiteSetting.edit_wiki_post_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
topic.first_post.update!(wiki: true)
sign_in(user_2)
@@ -1887,6 +1887,7 @@ RSpec.describe TopicsController do
expect(response.status).to eq(403)
user_2.update!(trust_level: 2)
Group.refresh_automatic_groups!
expect do put "/t/#{topic.id}/tags.json", params: { tags: [tag.name] } end.to change {
topic.reload.first_post.revisions.count