FEATURE: per-category approval settings (#5778)

- disallow moving topics to a category that requires topic approval
This commit is contained in:
Kyle Zhao
2018-07-12 22:51:08 -04:00
committed by Sam
parent db67c87916
commit 2901691e87
15 changed files with 187 additions and 7 deletions

View File

@@ -259,7 +259,7 @@ class TopicsController < ApplicationController
if params[:category_id] && (params[:category_id].to_i != topic.category_id.to_i)
category = Category.find_by(id: params[:category_id])
if category || (params[:category_id].to_i == 0)
guardian.ensure_can_create_topic_on_category!(category)
guardian.ensure_can_move_topic_to_category!(category)
else
return render_json_error(I18n.t('category.errors.not_found'))
end