redactor-rails
redactor-rails copied to clipboard
Add skip_authorization_check seems to be required...
I'm using the redactor-rails in an admin section for an app, when a user logs in and then can edit content.
When I try to upload an image, I get the error:
This action failed the check_authorization because it does not authorize_resource.
Add skip_authorization_check to bypass this check.
Is there a way around this? Or something I'm doing wrong?
cheers
- Chris
I'm having the same issue. How can I bypass this?
@chrxs @SammyLin What did you end up doing?
+1
@Averethel Hi Sakwerda. Do you have a temporary solution to this one?
I ended up with quite ugly workaround.
I defined: redactor_controller?
method in my ApplicationController returning true for redactor controllers (it was simple checking if controller is in the redactor namespace).
Then according to CanCan documentation I added ``check_authorization unless: :redactor_controller?` which did a trick.
Other option would be to define a module adding skip_authorization_check
and include it in the base redactor controller.
Or you can disable check_authorization
. After all it's only a development help so you can live without it on production.
THanks for the quick response. I'll look into it.
Should be relatively easy to fix in the real gem though. Shouldn't it?
All the best
Holger Sindbaek Holgersindbaek.com (http://Holgersindbaek.com)
Co-founder Uninkd.com (http://Uninkd.com) Meer.li (http://Meer.li)
On Monday, August 26, 2013 at 4:48 PM, Krzysztof Sakwerda wrote:
I ended up with quite ugly workaround. I defined: redactor_controller? method in my ApplicationController returning true for redactor controllers (it was simple checking if controller is in the redactor namespace). Then according to CanCan documentation I added `check_authorization unless: :redactor_controller? which did a trick.
Other option would be to define a module adding skip_authorization_check and include it in the base redactor controller. Or you can disable check_authorization. After all it's only a development help so you can live without it on production.— Reply to this email directly or view it on GitHub (https://github.com/SammyLin/redactor-rails/issues/81#issuecomment-23267442).
You're welcome. That's true. I guess point is that not everyone is using CanCan ;)
Has a better solution been found for this?