CanCan + Rolify does exactly what the OP wants.
I thought CanCan was abandoned when Rbates took some time off? https://github.com/ryanb/cancan
Role-based authorization in Rails
11–20 of 24 posts
Re: Role-based authorization in Rails
#12CanCan + Rolify does exactly what the OP wants.
I thought CanCan was abandoned when Rbates took some time off? https://github.com/ryanb/cancan
Re: Role-based authorization in Rails
#13I'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.
Re: Role-based authorization in Rails
#14Re: Role-based authorization in Rails
#15I do like the access-granted DSL. It seems to address some of CanCan's problems on larger more complex projects. Also... if you prefer a more OO style, I wrote a 50 line authorization lib that has proved workable on some of my larger projects. https://github.com/hopsoft/perm
Re: Role-based authorization in Rails
#16I'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.
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.
Re: Role-based authorization in Rails
#17I think the pattern that needs to be explored is a rails engine that has a web interface to manage permissions for different models. Usually stakeholders want to control the roles and permissions.
Re: Role-based authorization in Rails
#18Re: Role-based authorization in Rails
#19I'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.
Re: Role-based authorization in Rails
#20I'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.
Indeed, 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 w…