-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Getting CanCan::AuthorizationNotPerformed when creating comments #919
Comments
I don't think |
So there's no solution for this? |
Have you tried |
Yup that did the trick. I wish there was a different way though because this means that I can't use cancan to manage who can comment. # application_controller.rb
before_filter :check_authorization, :unless => :admin_comments_controller?
def admin_comments_controller?
controller_path == 'admin/comments'
end |
So, I'm not sure if you have found a solution to this or still need a solution, but I solved a similar issue the following way: From my understanding, CanCan is looking for particular resources to authorize when using that callback for every action. Therefore, in ActiveAdmin, it doesn't explicitly create model files for certain models. I had one for a different app and simply created a model for the controller action I was trying to create. I would recommend explicitly creating a |
here is how i did it
|
I'm getting
when I try to post a comment. The weird thing is that comments are created anyway. I have
check_authorization
in my application controller so every action needs to be authorized but I'm not sure how to authorizeAdmin::CommentsController#create.
The text was updated successfully, but these errors were encountered: