diff --git a/lib/new_post_manager.rb b/lib/new_post_manager.rb index f66421d66..2054374af 100644 --- a/lib/new_post_manager.rb +++ b/lib/new_post_manager.rb @@ -71,7 +71,7 @@ class NewPostManager return false if user.staff? || user.staged - (user.post_count < SiteSetting.approve_post_count) || + (user.trust_level == TrustLevel.levels[:newuser] && user.post_count < SiteSetting.approve_post_count) || (user.trust_level < SiteSetting.approve_unless_trust_level.to_i) || is_fast_typer?(manager) || matches_auto_block_regex?(manager) diff --git a/spec/components/new_post_manager_spec.rb b/spec/components/new_post_manager_spec.rb index 57be6bfe3..689ad1605 100644 --- a/spec/components/new_post_manager_spec.rb +++ b/spec/components/new_post_manager_spec.rb @@ -72,6 +72,7 @@ describe NewPostManager do context 'with a high approval post count' do before do SiteSetting.approve_post_count = 100 + topic.user.trust_level = 0 end it "will return an enqueue result" do result = NewPostManager.default_handler(manager) @@ -80,6 +81,17 @@ describe NewPostManager do end end + context 'with a high approval post count, but TL1' do + before do + SiteSetting.approve_post_count = 100 + topic.user.trust_level = 1 + end + it "will return an enqueue result" do + result = NewPostManager.default_handler(manager) + expect(result).to be_nil + end + end + context 'with a high trust level setting' do before do SiteSetting.approve_unless_trust_level = 4