Kavita
Kavita

Reputation: 31

How to handle authorizations based on different subscriptions to users in rails 3?

I am working on Rails 3.2. I am currently building tenant-based site which provides registration to the users. For users those want to register to the site, they need to get subscription plan provided from the site. Based on these subscriptions, I am supposed to provide different authorizations to users. For example, Plan A-subscription will allow user to create some 100 contacts, 100 events and no document uploads, while Plan B-subscription will allow user to create some 250 contacts, 200 events with document uploading features, etc. with further plans.

For this, I require data access authorizations at model level too. In a nutshell, these functioning specifically lists all authorizations and Access Control lists for the users.

As working on Rails 3.2, I have found few gems which will help to declare authorization-rules for users.

  1. fat_model_auth
  2. declarative_authorization

These gems allow to specify authorization-rules for the application. But I need authorization-rules also at Model level while limiting the access to the database from the user's side. Please suggest me with few documentation or gems to get through... Any suggestions would be helpful..

Upvotes: 0

Views: 456

Answers (2)

Brent Greeff
Brent Greeff

Reputation: 193

As the creator of fat_model_auth I can recommend it.

https://github.com/brentgreeff/fat_model_auth

Just released a new gem which works great with Rails 5.

Upvotes: 0

Hugo
Hugo

Reputation: 12914

I would suggest CanCan

there is a nice screencast on it aswell.

Upvotes: 1

Related Questions