class Acl9::AccessDenied
This exception is raised whenever ACL block finds that the current user is not authorized for the controller action he wants to execute. @example How to catch this exception in ApplicationController
class ApplicationController < ActionController::Base rescue_from 'Acl9::AccessDenied', :with => :access_denied # ...other stuff... private def access_denied if current_user # It's presumed you have a template with words of pity and regret # for unhappy user who is not authorized to do what he wanted render :template => 'home/access_denied' else # In this case user has not even logged in. Might be OK after login. flash[:notice] = 'Access denied. Try to log in first.' redirect_to login_path end end end