Added an extra layer of security towards not deleting threads

This commit was merged in pull request #56.
This commit is contained in:
Futseh
2019-02-24 18:55:33 +01:00
parent d52bf6d586
commit 2fe1cead68

View File

@@ -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