Restful Authentication - Check User admin status
def is_admin? #TODO: make into an accessor? return false unless self.tiers tier_names = self.tiers.collect {|t| t.name} return tier_names.include? "admin" end
TextSnippets > deckard > restful_authentication
2760 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
def is_admin? #TODO: make into an accessor? return false unless self.tiers tier_names = self.tiers.collect {|t| t.name} return tier_names.include? "admin" end