Skip to content

Integrating cancan for authorization only works once #13

@randomutterings

Description

@randomutterings

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions