A
A
Andrey2018-03-02 15:37:31
Ruby on Rails
Andrey, 2018-03-02 15:37:31

Why can't CanCan upload images to the server (ckeditor)?

When uploading an image to the server ( gem ckeditor ), a request is sent to (this controller is located in the gem)Ckeditor::PicturesController#create

CanCan::AuthorizationNotPerformed (This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.

Of course, if you write it in a Ckeditor::PicturesControllerline skip_authorization_check, then everything will work. But how to avoid the error without resorting to mankipatching.
I'm trying to register in abillity.rb
can :manage, Ckeditor::Picture
can :manage, Ckeditor::AttachmentFile

But it still doesn't help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question