From 2fe1cead68d3f66be5a9c6003990362e99bc1307 Mon Sep 17 00:00:00 2001 From: Futseh Date: Sun, 24 Feb 2019 18:55:33 +0100 Subject: [PATCH] Added an extra layer of security towards not deleting threads --- app/controllers/forumthreads_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/forumthreads_controller.rb b/app/controllers/forumthreads_controller.rb index 4b72bc7..4a3a5c1 100644 --- a/app/controllers/forumthreads_controller.rb +++ b/app/controllers/forumthreads_controller.rb @@ -73,7 +73,7 @@ class ForumthreadsController < ApplicationController end def destroy - if mod? || @thread.author.is?(current_user) + if mod? || (@thread.author.is?(current_user) && !@thread.forum.disable_deletion) if @thread.destroy flash[:notice] = "Thread deleted!" else