Rails CanCanCan database-driven authorization - Abilities in Database

21-May-2020 2043
If you are reading this post, it means you already know a thing or two about Ruby on Rails and CanCanCan. As users of this amazing gem, we know how easy it is to set up authorization for users using abilities. Like all worldly things, everything comes with a good part and a bad part.Recently, I published a post on setting up Authorization using CanCanCan but I came across several inputs, suggestions, and critics about the same in various social media. You can read about it here. Here are some of the points that are important:The ability file grows large as the application grows and hence, hard to maintain.Every change to the abilities requires a redeployment of the application. Overkill?Well, Pundit is favored by some because of its concept of writing policies for each resource which is pretty easy to maintain.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle