Fork Me on GitHub


Role management library with resource scoping

Download this project as a .zip file Download this project as a tar.gz file

Very simple Role management library without any authorization enforcement supporting scope on resource object (class checking and resource checking).

Let’s see an example:

> user.has_role?(:moderator, Forum.first)
=> false # if user is moderator of another Forum

This library is generic enough to be used by any authentication/authorization solutions. Look at his Tutorial if you want to checkout an example showing how to integrate rolify with CanCan and Devise.



In Rails 3, add this to your Gemfile and run the bundle command:

   gem 'rolify'

Alternatively, you can install it as a plugin:

$ rails plugin install git://

Authors and contributors

Author: Florent Monbillard (@EppO)

Contributors: Scott Tesoriere (@scottkf), Ullrich Schäfer (@stigi), Nicolas Fouché (@nfo)




Having trouble with rolify ? Check out the documentation and/or submit an issue.