Skip to content

Instantly share code, notes, and snippets.

@elricstorm
Created January 17, 2010 19:33
Show Gist options
  • Save elricstorm/279530 to your computer and use it in GitHub Desktop.
Save elricstorm/279530 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery
include AuthenticatedSystem
private
# Defining a function called authorize which will make sure that any pages we don't want accessible
# by a real admin will force the user to the root page.
def authorize
unless logged_in? && User.find(current_user).admin? && User.find(current_user).super?
redirect_to root_url
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment