-
Notifications
You must be signed in to change notification settings - Fork 11
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
Integrating cancan for authorization only works once #13
Comments
I changed out load_and_authorize_resource for authorize_resource :class => false and I'm just using can :manage, :logged_exceptions for some users in my ability class but it still only works once when I restart the application. |
A simple :before_filter also only runs the first time in any environment. Could not isolate the cause. Anyone found something out? |
No, I abandoned :logged_exceptions in favor of emailing exceptions. This will work for now but once we go public I'll need a more robust solution (one where a minor bug won't flood my inbox). At that point I'll re-evaluate :logged_exceptions and if I can't work out the issue, I'll check out something like hoptoad. |
I'm having the exact same issue! before_filter only runs the first time. I'll post back if I find anything but any help is appreciated. |
In my case I'm trying to integrate exception_logger with Spree, so ended up using |
I end up using HTTP Basic Authentication, looks like it's working well. Metavida, how did you manage to do that? |
My solution is probably pretty specific to using Spree. With spree installed, any file that you place in the
|
My initializer code.
Myapp::Application.config.after_initialize do
LoggedExceptionsController.class_eval do
load_and_authorize_resource
end
end
When logged in as an unauthorized user I get redirected correctly once when the app is restarted but after that I am able to access the logged_exceptions page. I've tried moving this code to application.rb and development.rb (without Myapp::Application) with no success. No matter what I do I can't get the authorization to work more than once when the app is restarted. Any ideas?
The text was updated successfully, but these errors were encountered: