Module: RadiantTools::EnforceAdmin
- Defined in:
- lib/radiant_tools/enforce_admin.rb
Class Method Summary collapse
Class Method Details
.init ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/radiant_tools/enforce_admin.rb', line 2 def self.init [Admin::ResourceController, Admin::ConfigurationController].each do |klass| klass.class_eval do prepend_before_filter :enforce_admin! protected def enforce_admin! return redirect_to logout_url unless current_user && current_user.admin? end end end end |