4 ms·
I've been using Pundit, which is model-based, rather than role-based, and it works really nicely with Rails conventions. Model-based feels more natural than
by ebola1717 11y ago
I've been using Pundit, which is model-based, rather than role-based, and it works really nicely with Rails conventions. Model-based feels more natural than role based, IMO.
- Abundnce10 11y agoI've used Pundit in my last few projects and loved the simplicity of it. Would recommend to others.
- gkop 11y agoIndeed, the author is framing Access Granted against CanCan/CanCanCan, when Pundit has already picked up the torch of Rails authorization. Pundit made the design decision to be as close to pure Ruby as possible, and therefore is extremely flexible (similar to the design philosophy of Strong Parameters). Access Granted seems like a step backwards (toward a DSL) from Pundit. So it would take a strong argument to show why Access Granted is preferable to Pundit.
- carlosdp 11y agoYea I thought the same thing when reading this. Pundit is already well adopted and covers this use case, this seems like re-inventing the wheel a bit atm.
- opiotrek 11y agoI personally dislike Pundit's way of defining permissions, but as always it's a preference. I really wanted to keep CanCan's simplicity, but add roles while cleaning abilities/policies up.
- carlosdp 11y agoPundit is excellent, it doesn't tie you to any one model of authorization, it just gives you a standard way to implement your own in a very light-weight fashion.