Build Status Code Climate Coverage Status

ActsAsRoleable

Adds role based authorization to Rails using the lovely RoleModel and the scopes of Canard. No Authorization, just roles.

To be renamed and released.

Installation

Add this line to your application's Gemfile:

gem 'acts_as_roleable'

And then execute:

$ bundle

Or install it yourself as:

$ gem install acts_as_roleable

Usage

Any model you want to support roles and handy role scopes for, add:

acts_as_roleable roles: [:tester, :user, :owner]

And be sure to add a roles_mask:integer column to the associated table. You can change the name of this column by passing the roles_mask attribute:

acts_as_roleable roles: [:tester, :user, :owner], roles_mask: :internal_mask

Contributing

  1. Fork it (http://github.com/<my-github-username>/acts_as_roleable/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request