about summary refs log tree commit diff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-11-23 23:10:05 -0600
committerFire Demon <firedemon@creature.cafe>2020-11-23 23:10:05 -0600
commit65a9abb315f18ac777f3d0e09b3f7399830ad243 (patch)
tree39712b50201749efad11dce09561d81f4bdcdb2f /app/controllers/application_controller.rb
parent7f5ba917563aa1c9a373d9dd3a6a29f73d81ee9a (diff)
Add user options to disable recipient verification, allow anonymous public access; rework private mode
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 5e12e89c8..9074e6450 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -49,7 +49,7 @@ class ApplicationController < ActionController::Base
   end
 
   def authorized_fetch_mode?
-    !(Rails.env.development? || Rails.env.test?)
+    !(current_account&.allow_anonymous? || (@account&.id && current_user&.account_id == @account.id) || Rails.env.development? || Rails.env.test?)
   end
 
   def public_fetch_mode?
@@ -90,8 +90,8 @@ class ApplicationController < ActionController::Base
     end
   end
 
-  def require_following!(account)
-    forbidden unless following?(account)
+  def require_following!
+    forbidden unless @account.present? && following?(@account)
   end
 
   def after_sign_out_path_for(_resource_or_scope)