Method: Symphonia::ControllerExtensions#authorize
- Defined in:
- lib/symphonia/controller_extensions.rb
#authorize ⇒ Object
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/symphonia/controller_extensions.rb', line 168 def if Symphonia::User.current.(controller_name, action_name) return true else if Symphonia::User.current.logged_in? raise else respond_to do |format| format.html do return redirect_to(symphonia.login_path(back_url: request.path), error: t(:text_error_login_required)) end format.any { return head 401 } end end end raise end |