Class: CanHasPermission::Role

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/can-has-permission/role.rb

Instance Method Summary collapse

Instance Method Details

#can?(permission) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/can-has-permission/role.rb', line 9

def can?(permission)
  return true if (!self.permissions.select{|p| p.name == permission.to_s}.empty?)
  false
end