FIX: Staff can create and edit posts even if a topic is in slow mode. (#11057)

Additionally, ninja edits are no longer restricted.
This commit is contained in:
Roman Rizzi
2020-10-28 16:47:50 -03:00
committed by GitHub
parent e3de45359f
commit 2f32336081
8 changed files with 73 additions and 6 deletions

View File

@ -159,7 +159,7 @@ class PostCreator
return false
end
if @topic&.slow_mode_seconds.to_i > 0
if guardian.affected_by_slow_mode?(@topic)
tu = TopicUser.find_by(user: @user, topic: @topic)
if tu&.last_posted_at