Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment