FEATURE: Allow category moderators to set auto deletion topic timers (#19383)

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
This commit is contained in:
Rafael dos Santos Silva
2022-12-08 17:14:43 -03:00
committed by GitHub
parent 86d49f4fb1
commit 9f3760cfd8
5 changed files with 102 additions and 3 deletions

View File

@ -497,6 +497,10 @@ class TopicsController < ApplicationController
topic = Topic.find_by(id: params[:topic_id])
guardian.ensure_can_moderate!(topic)
if TopicTimer.destructive_types.values.include?(status_type)
guardian.ensure_can_delete!(topic)
end
options = {
by_user: current_user,
based_on_last_post: based_on_last_post