- Cancan and devise not working
- class Ability
- include CanCan::Ability
- def initialize(user)
- user ||= User.new # guest user (not logged in)
- if user.clearance.equal?("2")
- can :create, Post
- can :manage, Post, :user_id => user.id
- else
- can :read, :all
- end
- end
- end