ryanb / cancan

Authorization Gem for Ruby on Rails.
MIT License
6.27k stars 784 forks source link

CanCan Authorisation #748

Open aavinash opened 11 years ago

aavinash commented 11 years ago

Hello,

I have a requirement :-

In user.rb I have :- has_many :permissions User has roles as well as permissions. So one role can have multiple permissions. Here my Role is "Admin". Admin can have multiple permissions to access the application. How can CanCan help me on this to authorize permissions for a role, i.e. Admin ?

Thanks

mikepack commented 11 years ago

CanCan is an authorization system that allows you to define permissions on a specific object or class of objects. From your explanation, it sounds like the following resources would be helpful for you:

In CanCan, you define abilities based on attributes of the objects. You then check if the object has valid permissions, usually done in a Rails controller or view.

It also looks like you might be trying to put permissions in the database. If so, read the wiki on abilities in the database.

xhoy commented 10 years ago

Dear submitter, Since cancan/raynB hasn't been active for more than 6 months and no body else then ryam himself has commit permissions the cancan project is on a stand still. Since cancan has several issues including missing support for rails 4 cancan is moving forward to cancancan. More details on: #994

If your feel that your pull request or bug is still applicable (and hasn't been merged in to cancan) it would be really appreciated if you would resubmit it to cancancan (https://github.com/cancancommunity/cancancan)

We hope to see you on the other side!