Created
January 17, 2010 19:33
-
-
Save elricstorm/279530 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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