app/controllers/application_controller.rb
# Authorize patron access to this application
# * Has access if authorized, exception or admin
# * If logged in but not authorized, rendered an error page
# * Otherwise redirect to login page, no anonymous access allowed
Authorize patron access to this application
Has access if authorized, exception or admin
If logged in but not authorized, rendered an error page
Otherwise redirect to login page, no anonymous access allowed
Authorize patron access to this application Has access if authorized exception or admin If logged in but not authorized rendered an error page Otherwise redirect to login page no anonymous access allowed
def authorize_patron
    unless current_user.nil?
      if current_user.admin? or current_user.override_access? or current_user.authorized?
        return true
      else
        render 'errors/unauthorized_patron'
      end
    else
      redirect_to login_url(origin: request.url) unless performed?
    end
  end
def authorize_patron unless current_user . nil? if current_user . admin? or current_user . override_access? or current_user . authorized? return true else render 'errors/unauthorized_patron' end else redirect_to login_url ( origin : request . url ) unless performed? end end
Authorize patron access to this application
 Has access if authorized, exception or admin
 If logged in but not authorized, rendered an error page
 Otherwise redirect to login page, no anonymous access allowed
Authorize patron access to this application Has access if authorized exception or admin If logged in but not authorized rendered an error page Otherwise redirect to login page no anonymous access allowed