Added an extra layer of security towards not deleting threads
This commit was merged in pull request #56.
This commit is contained in:
@@ -73,7 +73,7 @@ class ForumthreadsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
if mod? || @thread.author.is?(current_user)
|
if mod? || (@thread.author.is?(current_user) && !@thread.forum.disable_deletion)
|
||||||
if @thread.destroy
|
if @thread.destroy
|
||||||
flash[:notice] = "Thread deleted!"
|
flash[:notice] = "Thread deleted!"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user