Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Authorization / Permissions plugin for Rails

By Peter Cooper / July 21, 2006

Authorizationplugin

The "Authorization plugin" is an interesting plugin for Ruby on Rails that provides role based authorization for your app. It's particularly interesting because it includes some 'English-like' dynamic methods that can use the defined roles. For example, user.is_fan_of angelina and angelina.has_fans? where 'fans' are defined in the roles table. Also look at the code example in the graphic above.

You can also do things like user.is_eligible_for_what (returns an array of authorized objects on which the user has the 'eligibile' role) and user.is_moderator_of?(group) (returning true or false if the user has the moderator role upon group). Powerful stuff!

The latest version was released just a few days ago so it should all be ready for full Rails 1.1 goodness.

Other Posts to Enjoy

Twitter Mentions