4 ms·
I think this is more of a strategy question. I'd approach this problem by defining each user to belong to a plan. Then with authorization gems such as CanCan, d
by bdclimber14 16y ago
I think this is more of a strategy question. I'd approach this problem by defining each user to belong to a plan. Then with authorization gems such as CanCan, define the actions that can be accomplished with each role.
For example, one ability definition would be for adding new files. It would check that the user's used space has not exceeding the user's plan allotment.
I hope this helps some, but I doubt you'll find a silver bullet gem or service because this requires some deep application logic.
- marcamillion 16y agoI am using devise and auth_logic for authentication and authorization. But I am struggling with rolling my own, so was wondering if there is a gem that does it. I found one - https://github.com/linoj/saasramp https://github.com/linoj/saasramp - but doesn't seem to be written for Rails 3 (and hasn't been updated). Know of any others like that, but for Rails 3 ?
- bdclimber14 16y agoI think you may be confused with a couple things. Devise and AuthLogic are both authentication gems, and wouldn't be used together. They only authenticate a user, but they don't authorize actions. For authorization, a gem like CanCan would be a good fit. saasramp looks like a way to do handle CC's and submit for processing. From my experience, don't do this. Let Chargify or someone else handle payments on a hosted payment page. It's not worth the risk.
- marcamillion 16y agoSorry...I meant declarative_authorization. Yeh, I don't want to handle CCs & submit for processing. I need assistance with the application logic, but I think I got it. Thanks.