| Path: | README |
| Last Update: | Fri Jan 25 08:50:53 -0700 2008 |
Bolt is yet another authentication/authorization plugin for Ruby on Rails, implemented as a Rails Engine. It is a full service plugin, providing models, controllers, and views.
Authentication and Authorization are both provided by the plugin. There is also support for working with any loaded class for authentication, making it easy to authenticate with an external source such as LDAP.
As of January 25, 2008:
Bolt is currently being used in production. It has a health set of unit and functional tests that are all passing.
It is, however, missing a few view files for the password changing controller, and such controllers need to be documented.
As soon as those items are done, I‘ll release 1.0.
Rails Engines needs to be installed into your Rails application. You can find out more about Rails Engines here: rails-engines.org/
Once you have Rails Engines installed, place Bolt into your vendor/plugins directory as you would any other plugin. Then follow these steps:
Bolt::Initializer.run do |bolt| bolt.application_name = 'My Fancy Rails Application' bolt.email_from = 'Account Team <me@example.com>' end
For a complete list of configuration options that Bolt uses, please see Bolt::Config.
The Bolt plugin provides a SessionsController that performs the work of authenticating and logging a user in. You can request that a user be authenticated by using the require_authentication class method in your controller.
See Bolt::Authentication::ClassMethods for more details about requesting that authentication happen.
There are a few authentication state helper methods added to all your controllers and views. You can read about these helpers in Bolt::State. These helpers include current_user.
Authorization is achieved through roles. Users are associated with roles, and roles have specific permissions. Each user can optionally be associated with one or more roles, and a role can have any number of permissions.
There are a number of authorization helper methods that are added to your user model class. You can find out more information about these methods, such as can? in the Bolt::UserModelExt module.
You can have your controller perform authorization by using the require_authorization class method.
For more specific information about authorization, please see Bolt::Authorization.
Bolt is a derivative of Peter Jones’ Rauth plugin for Rails, which itself was taken from the Devalot Rails application.
Since Bolt is derived from Rauth, it might be useful to compare the two. The biggest difference is that Bolt is a Rails Engine, whereas Rauth is a traditional Rails plugin.
Bolt is also greatly simplified. The bridge and account creator code has been removed, and all configuration options have been moved to a single class (Bolt::Config).
Rauth limited you to one role per person. Bolt allows a single user to belong to many roles. This is more in-line with the Unix group philosophy.
A conversion script is in the works. Stay tuned.
The primary author and maintainer of Bolt is Peter Jones. Bolt is an open source project, and has thus has received help from many developers: