access-granted icon indicating copy to clipboard operation
access-granted copied to clipboard

Support for authorize_resource!

Open abitdodgy opened this issue 12 years ago • 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.

abitdodgy avatar Feb 13 '14 18:02 abitdodgy

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.

pokonski avatar Feb 14 '14 02:02 pokonski

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.

abitdodgy avatar Feb 14 '14 10:02 abitdodgy

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

On 14/02/2014, Mohamad El-Husseini [email protected] 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: https://github.com/pokonski/access-granted/issues/4#issuecomment-35072638

Piotr Okoński [email protected] | +48 792 097 151

pokonski avatar Feb 14 '14 10:02 pokonski

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!

winston avatar Nov 19 '15 16:11 winston