chaps-io/access-granted

Support for authorize_resource!

abitdodgy opened this issue · 4 comments

It would be nice not having to call authorize! in every controller method. Do you have any plans to include this functionality?

I'm curious, how much work/how complicated is it?

I might be out of my depth, but I'm willing to give it a crack if you think it's useful, and if I can get some guidance.

Hi!

Absolutely, forgot about this actually :) I will add the before_filter support just like in CanCan. Though most likely this will be in a wrapper gem access-granted-rails to keep the core framework-agnostic.

Thanks for spotting this and I hope access-granted will make your life easier.

Great to hear. Just an FYI, I was never a big fan of the load_and_authorize_resource!. I always had the need to use scopes and custom queries, which never played well with CanCan. authorize_resource!, on the other hand, was great, until it stopped working for me in Rails 4.

You are right, I don't want to load resources. Too much overwriting anyway.

On 14/02/2014, Mohamad El-Husseini notifications@github.com wrote:

Great to hear. Just an FYI, I was never a big fan of the
load_and_authorize_resource!. I always had the need to use scopes and
custom queries, which never played well with CanCan. authorize_resource!,
on the other hand, was great, until it stopped working for me in Rails 4.


Reply to this email directly or view it on GitHub:
#4 (comment)

Piotr Okoński
piotrek@okonski.org | +48 792 097 151

You are right, I don't want to load resources.

Sorry. Does this mean that bringing in load_and_authorize_resource is out of the question?
Am asking because I use that pretty often. Thanks!