From 7d52f5869db77cf752da9d8e40fd070569db939b Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 9 Nov 2018 15:25:38 +1100 Subject: [PATCH] Revert "FIX: Don't enqueue topics if the user can't create them" This reverts commit 515e103db624cec01f6d15e9fda74e165d4f855d. --- lib/new_post_manager.rb | 8 -------- spec/components/new_post_manager_spec.rb | 18 ------------------ 2 files changed, 26 deletions(-) diff --git a/lib/new_post_manager.rb b/lib/new_post_manager.rb index 3938a34ea43..6fe08f93c41 100644 --- a/lib/new_post_manager.rb +++ b/lib/new_post_manager.rb @@ -119,14 +119,6 @@ class NewPostManager result.errors[:base] << I18n.t(:topic_not_found) return result end - elsif manager.args[:category] - category = Category.find_by_id(manager.args[:category]) - - unless manager.user.guardian.can_create_topic_on_category?(category) - result = NewPostResult.new(:created_post, false) - result.errors[:base] << I18n.t("js.errors.reasons.forbidden") - return result - end end result = manager.enqueue('default') diff --git a/spec/components/new_post_manager_spec.rb b/spec/components/new_post_manager_spec.rb index 094ed175c45..347adbb132a 100644 --- a/spec/components/new_post_manager_spec.rb +++ b/spec/components/new_post_manager_spec.rb @@ -104,24 +104,6 @@ describe NewPostManager do end end - context 'with a high approval post count and secure category' do - it 'does not create topic' do - SiteSetting.approve_post_count = 100 - user = Fabricate(:user) - category_group = Fabricate(:category_group, permission_type: 2) - group_user = Fabricate(:group_user, group: category_group.group, user_id: user.id) - - manager = NewPostManager.new( - user, - raw: 'this is a new topic', - title: "Let's start a new topic!", - category: category_group.category_id - ) - - expect(manager.perform.errors["base"][0]).to eq(I18n.t("js.errors.reasons.forbidden")) - end - end - context 'with a high trust level setting' do before do SiteSetting.approve_unless_trust_level = 4