Reputation: 293
I have a rails app where users can buy and sell products. I have implemented the authentication system from devise.
But now I want to have two different types of users (sellers, buyers). At the time of signup, users can choose what role they want.
I had seen many tutorials but none of them was helpful.
Should I use CanCanCan?
Is there a simpler alternative?
Upvotes: 1
Views: 318
Reputation: 34338
CanCan was a very popular gem for authorization developed by Ryan Bates but it's not maintained anymore. The community-based CanCanCan project maintains an updated version of CanCan.
The Pundit gem is gaining a lot of popularity for Rails authorization lately and it's very well maintained. So, it's preferred these days.
There is another one authority
While cancan
and pundit
are the most popular choices for production grade Rails applications, if you want something really lightweight,
action_access is the way to go and its work very well with Rails 4.
Upvotes: 1