Database-driven authorization in Rails using CanCanCan – Abilities in DB and MetaProgramming

Hi ruby family,

As an initiative to give back to the community, I have started writing a series of blogs on ruby and ruby on rails. A few days back, I published a post on authorizing resources in rails using CanCanCan. As a continuation of the previous post, I have recently published another post on how to implement database-driven authorization using CanCanCan.

Some of the key issues that I tried to solve was :

1. The Growing size of the ability file

2. Abilities being hard to maintain.

3. Redeployment of the application for every change in the ability file

4. Storing abilities in a database

If you think this can be extrapolated and be made into a gem, let me know, and let's work together to create an awesome library.


You check out my previous post here -


Leave a Comment