This gem lets you use the CanCanCan gem (https://github.com/CanCanCommunity/cancancan) with Padrino framework. Note that CanCanCan is a continuation of CanCan (https://github.com/ryanb/cancan), the authorization gem for Ruby on Rails.
Add this line to your application's Gemfile:
gem 'padrino-cancancan'
And then execute:
$ bundle
Or install it yourself as:
$ gem install padrino-cancancan
This gem works with existing Padrino::Admin::AccessControl module and expects current_account to be available. For more info about AccessControl, checkout: http://www.padrinorb.com/guides/padrino-admin#admin-authentication
In your app.rb, register Padrino::CanCan (NOTE: 'Can' in the module name is two times and NOT 3 times as in the gem's name)
class App < Padrino::Application
register Padrino::CanCan
...
end
Place your ability.rb in your app/models/ directory
Except for the generators, you can use CanCanCan as you would in a Rails App. All documentation is on the CanCanCan wiki: https://github.com/CanCanCommunity/cancancan/wiki
- Fork it ( https://github.com/sliaquat/padrino-cancancan/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 a new Pull Request