Authorization and Routes

See: AbstractController::Callbacks::ClassMethods#before_filter

And it might help to look at the way existing gems implement auth; see: Category: Web Authentication - The Ruby Toolbox

HTH,