FEATURE: wiki editors are allowed edit tags for wiki topics.

If a wiki editor's TL is greater than 'min trust level to tag topics' site setting then they can edit the tags for any wiki topic.
This commit is contained in:
Vinoth Kannan
2019-10-23 23:35:38 +05:30
parent 67ad8fbd1b
commit 31577b2131
12 changed files with 115 additions and 24 deletions

View File

@ -374,6 +374,16 @@ class TopicsController < ApplicationController
success ? render_serialized(topic, BasicTopicSerializer) : render_json_error(topic)
end
def update_tags
params.require(:tags)
topic = Topic.find_by(id: params[:topic_id])
guardian.ensure_can_edit_tags!(topic)
success = PostRevisor.new(topic.first_post, topic).revise!(current_user, { tags: params[:tags] }, validate_post: false)
success ? render_serialized(topic, BasicTopicSerializer) : render_json_error(topic)
end
def feature_stats
params.require(:category_id)
category_id = params[:category_id].to_i