Re:Rails – The Missing Parts – Policies
by Dorian-Marie on Thursday March 20, 2014 @01:54PM
(#7437333)
I would use CanCan ability.rb file for that: https://github.com/CanCanCommunity/cancancan
[ Parent
| on HN ]
My problem with CanCan is that when you begin to have more complicated access logic ability.rb becomes a giant mess.
It's already a file where you just throw in all of your authorization logic anyways so it always feels a bit unruly once you get beyond basics.
Re:Rails – The Missing Parts – Policies
by Jeff_Dickey on Friday March 21, 2014 @10:21AM
(#7442438)
I agree. The first app we wrote using CanCan, the `ability.rb` file (and the dozen files we factored out of that) grew to be... significant.
I love the idea of Pundit because it decouples all that as much as seems practical. I'm about to find out if theory informs practice or not...
Re:Rails – The Missing Parts – Policies
by Dirlewanger on Thursday March 20, 2014 @02:53PM
(#7437755)
This gem's function is so integral to an application I don't understand how it's not part of Rails.
Re:Rails – The Missing Parts – Policies
by mikesilvis on Thursday March 20, 2014 @02:05PM
(#7437409)
that's exactly what i was thinking...