An engine gem to provide a RDBMS backed list of roles and their associated user. This replaces the hydra default role mapper.
This gem supports both Rails 3 and 4.
gem 'hydra-role-management'to your Gemfile and then
rails generate roles
- Add the following cancan abilities:
# app/models/ability.rb if current_user.admin? can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role end
##Testing: Given the need to support both Rails 3 and 4, the test suite has been parameterized to test against any version of Rails.
- Ensure that the testing app does not exist:
bundle exec rake clean
- Set Rails version you want to test against. For example:
- Ensure that the correct version of Rails is installed:
- Build test app:
bundle exec engine_cart:generate
- And run tests:
bundle exec rake spec