diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-08-29 19:23:33 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-08-29 19:26:06 +0900 |
commit | f972504dd6c08dd474288ece8817e994beb926f8 (patch) | |
tree | 27c29d8675a893c607fb382e662e0c59640fd993 /app/controllers/application_controller.rb | |
parent | bc69345e4c6bce995f16836f3318a49179e9c5f2 (diff) | |
download | aclog-f972504dd6c08dd474288ece8817e994beb926f8.tar.gz |
implement opt-out
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 15cc108..9df7c73 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -31,6 +31,7 @@ class ApplicationController < ActionController::Base def authorize!(object) if object.is_a? User authorized_to_show_user?(object) || raise(Aclog::Exceptions::UserProtected, object) + object.try(:account).try(:opted_out?) && raise(Aclog::Exceptions::UserOptedOut, object) elsif object.is_a? Tweet authorize! object.user else |