Is it possible to define cancan for anonymous users in devise? Where an anonymous user “can” log in, a logged in user “cannot”.
Can I define cancan abilities for anonymous users, or should I avoid cancan for anonymous users?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure i understand the question completely. You can certainly allow anonymous users to do stuff with cancan
But I think you are actually asking ‘can you allow anonymous users to do something that signed in users cannot? That’s not something I’ve done, but i presume that you can use
If the question is specifically about logging in though – i think that is a subtly different problem – a user can read an article (or not), but a user is logged in (or not) and in this specific case I don’t think cancan is the right answer