mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user