
Untitled
By: a guest on
Jun 25th, 2012 | syntax:
None | size: 0.68 KB | hits: 16 | expires: Never
CanCan Authentication with Exception Logger
config.after_initialize do
LoggedExceptionsController.class_eval do
# include any custom auth modules you need
# (declarative authorization gem used)
filter_resource_access
# just add any code you want to be included in the controller ;)
# optional, sets the application name for the rss feeds
self.application_name = "Your Application Name"
end
end
load_and_authorize_resource #everyone gets locked out
authorize_resource :class => false #everyone gets locked out
authorize! :roll, :logs #exception gets raised (undefined method authorized! for LoggedExceptionsController)
can :manage, :logged_exceptions