No commit activity in last 3 years
No release in over 3 years
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.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Padrino Cancancan

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.

Installation

Add this line to your application's Gemfile:

gem 'padrino-cancancan'

And then execute:

$ bundle

Or install it yourself as:

$ gem install padrino-cancancan

Usage

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

Contributing

  1. Fork it ( https://github.com/sliaquat/padrino-cancancan/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 a new Pull Request