about summary refs log tree commit diff
path: root/app/controllers/settings
diff options
context:
space:
mode:
authormasarakki <masaki182@gmail.com>2017-06-19 22:12:31 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-06-19 15:12:31 +0200
commitff142eb64d2d1251f9df1baa0b302fd532ec30ed (patch)
tree66c9e30ddef330ae32d3b0adb75983bf38bc0a4b /app/controllers/settings
parent500e28442f8e6657de766fbdb4a4cfdb164b2b92 (diff)
setting-for-account-deletable (#3852)
Diffstat (limited to 'app/controllers/settings')
-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