Authorization and Routes

See: AbstractController::Callbacks::ClassMethods#before_filter

And it might help to look at the way existing gems implement auth;
see: https://www.ruby-toolbox.com/categories/rails_authentication

HTH,