Created
August 21, 2010 17:56
-
-
Save UserAd/542639 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module ActsAsAdmin | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def acts_as_admin | |
layout lambda{ |c| | |
if c.request.xhr? | |
nil | |
else | |
'admin2' | |
end | |
} | |
#ACL 9 rules here | |
before_filter :require_user | |
access_control do | |
allow :admin | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment