RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

EppO — 4 posts

http://github.com/EppO/rolify

rolify gem allows you to manage the roles in your app easily and provides the ability to scope the role on a resource instance or class: user.add_role :moderator, Forum.find(3)
It integrates smoothly with Devise and CanCan to build a full authentication/authorization stack

3.2 release includes new handy features like callbacks when roles are added/removed, helper methods on the resource class and the User class to find resources/users depending the roles they have, and lot more !
I just released rolify 3.0 gem. It introduces the Mongoid ORM support in addition of the ActiveRecord adapter. This comes with a complete re-design of the library and heavy code refactoring. Specs coverage has been enhanced as well.
If you want to see how to integrate rolify with Devise (authentication library) and CanCan (authorization library), check out this tutorial.
If you are developing a Rails 3.1 project and look for a Role management library that you could plug with Devise and CanCan, then you should consider rolify.
Version 2.0 includes performance improvement, initializer code cleaned up, spec coverage enhancement, opinionated defaults and support for many different rubies (1.8/1.9, REE, Rubinius and JRuby).
Currently it works only with for ActiveRecord but there are plans to support Mongoid in a not too near future.

Give it a try ! check it out here and install it using rubygems: gem install rolify
I just released rolify 1.1, this ruby gem provides a simple way to manage different kind of roles in your application. Let say you don't want just global roles in your application and/or you don't want them to be hardcoded. Rolify allows you to define 3 role scope levels:

global: @user.has_role "admin"
class scoped: @user.has_role "moderator", Forum
resource scoped: @user.has_role "moderator", Forum.find(3)


rolify doesn't enforce any authentication/authorization, but it's flexible enough to be integrated easily with any authentication/authorization library. Here is a tutorial showing how to integrate rolify with CanCan and Devise