From 79995e43090849b72e147258a6c9e5cfc54226b4 Mon Sep 17 00:00:00 2001 From: Ryan Bates Date: Tue, 22 Feb 2011 09:37:53 -0800 Subject: [PATCH] adding Lock It Down section to readme --- README.rdoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.rdoc b/README.rdoc index 78fe3b7..16d908d 100644 --- a/README.rdoc +++ b/README.rdoc @@ -77,6 +77,17 @@ If the user authorization fails, a CanCan::AccessDenied exception will See {Exception Handling}[https://github.com/ryanb/cancan/wiki/exception-handling] for more information. +=== 4. Lock It Down + +If you want to ensure authorization happens on every action in your application, add +check_authorization+ to your ApplicationController. + + class ApplicationController < ActionController::Base + check_authorization + end + +This will raise an exception if authorization is not performed in an action. If you want to skip this add +skip_authorization_check+ to a controller subclass. See {Ensure Authorization}[https://github.com/ryanb/cancan/wiki/Ensure-Authorization] for more information. + + == Wiki Docs * {Upgrading to 1.5}[https://github.com/ryanb/cancan/wiki/Upgrading-to-1.5]