Skip to content

Commit

Permalink
a convenience method to simplify something we do all the time
Browse files Browse the repository at this point in the history
  • Loading branch information
bokmann committed Apr 14, 2010
1 parent 22693e3 commit b44ff91
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/stonewall/stonewall.rb
Expand Up @@ -33,5 +33,15 @@ class << self
def send?(method, user = User.current)
self.class.stonewall.allowed?(self, user, method)
end
alias_method :allowed?, :send?

def send_method_group?(group_name, user = User.current)
self.class.stonewall.method_groups[group_name].each do |method|
return false unless self.send?(method, user)
end
return true
end
alias_method :allowed_method_group?, :send_method_group?

end
end

0 comments on commit b44ff91

Please sign in to comment.