-
Notifications
You must be signed in to change notification settings - Fork 875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancan usage? #31
Comments
Try this: can [:index], Ckeditor::Picture if user.role? :user |
Thanks for the suggestion. I had tried that before and unfortunately that doesn't work. I just get CanCan::AccessDenied when using that. heres some lines from the stacktrace:
|
I had the same issue. I figured out that the protected
# Cancan example
def ckeditor_authenticate
if @asset
authorize! action_name, @asset
end
end Also, be sure your ability.rb file uses the suggestion from galetahub above: can [:index], Ckeditor::Picture if user.role? :user or can [:index], Ckeditor::Asset if user.role? :user |
I ran into this error also. For me what fixed it was removing |
Added support for cancan integration in this commit d336964 |
I get this error when trying to use cancan and attempt to browse images in ckeditor:
Expected <app_path>/app/models/ckeditor/picture.rb to define Picture
I have placed this in my
application_controller.rb
And this in
ability.rb
I suspect it could be something to do with the namespaced controller/models?
The text was updated successfully, but these errors were encountered: