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
- Fork it (
http://github.com/<my-github-username>/acts_as_roleable/fork
) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request