DEV: Users must be able to see a topic to moderate it. (#10906)

Follows-up a8c47e7c. It makes more sense to check if the user can see the topic inside the `can_moderate?` method instead of doing it separately.
This commit is contained in:
Roman Rizzi
2020-10-13 13:03:14 -03:00
committed by GitHub
parent b19e8ea206
commit 108414e47c
2 changed files with 4 additions and 2 deletions

View File

@ -453,7 +453,6 @@ class TopicsController < ApplicationController
params.require(:duration) if based_on_last_post
topic = Topic.find_by(id: params[:topic_id])
guardian.ensure_can_see!(topic)
guardian.ensure_can_moderate!(topic)
options = {