ryanb/cancan — Issue #567: CanCan with Devise STI roles.
Author: Plinpod
Created: 2012-03-02 02:24:28+00:00
State: open

Hey I setup some STI roles on my Devise users so each devise user has a type field which holds a string that is tells me what the role is.

I am trying to do this in my ability.rb file

```Ruby
def initialize(user)
can :read, :all
if user.is_a?(Admin)
can :access, :rails_admin
can :manage. :all
end
```
However I always get access denied with this. How can I get cancan to work with my setup? Thanks!