about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/settings/deletes_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/settings/deletes_controller.rb b/app/controllers/settings/deletes_controller.rb
index dd18b4c2f..80002b995 100644
--- a/app/controllers/settings/deletes_controller.rb
+++ b/app/controllers/settings/deletes_controller.rb
@@ -3,6 +3,7 @@
 class Settings::DeletesController < ApplicationController
   layout 'admin'
 
+  before_action :check_enabled_deletion
   before_action :authenticate_user!
 
   def show
@@ -21,6 +22,10 @@ class Settings::DeletesController < ApplicationController
 
   private
 
+  def check_enabled_deletion
+    redirect_to root_path unless Setting.open_deletion
+  end
+
   def delete_params
     params.require(:form_delete_confirmation).permit(:password)
   end