Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Rich and CanCan #77

Saicheg opened this Issue · 4 comments

3 participants



We are using rails-admin + cancan + rich for our admin panel. So we don't have separate AdminUser model for rails-admin and use cancan role instead.

The problem is that i can't access file upload dialog. I am getting this error from cancan:

'This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.'

Any ideas how i can include cancan's authorize_resource to Rich::FilesController?


You can set the authentication method that Rich uses in the initializer. You could try setting it to a custom method of your own which does whatever you need to authenticate a user.

Hope this helps!


Yeah, i see that. I will dig deeper inside how cacan handles authentication for users and submit my solution here.


@bastiaanterhorst i spent 2 hours today working on that issue and didn't find any solution for that. main reason that cancan create before_filter for checking authorization with a block instead of some method and delegate all logick to object, so you can't call it directly:
See this:

controller_class.send(before_filter_method, options.slice(:only, :except, :if, :unless)) do |controller|, resource_name, options.except(:only, :except, :if, :unless)).send(method)

Any suggestions?


@dunyakirkali do you have any idea?

@renews renews added the Fix-me label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.