Module: CanTango::License::Rules
- Included in:
- CanTango::License
- Defined in:
- lib/cantango/license/rules.rb
Instance Method Summary collapse
- #can(action, subject, conditions = nil, &block) ⇒ Object
- #cannot(action, subject, conditions = nil, &block) ⇒ Object
- #owns(user_account, clazz, ownership_relation = :user_id, user_id_attribute = :id) ⇒ Object
Instance Method Details
#can(action, subject, conditions = nil, &block) ⇒ Object
4 5 6 |
# File 'lib/cantango/license/rules.rb', line 4 def can(action, subject, conditions = nil, &block) ability.can action, subject, conditions, &block end |
#cannot(action, subject, conditions = nil, &block) ⇒ Object
8 9 10 |
# File 'lib/cantango/license/rules.rb', line 8 def cannot(action, subject, conditions = nil, &block) ability.cannot action, subject, conditions, &block end |
#owns(user_account, clazz, ownership_relation = :user_id, user_id_attribute = :id) ⇒ Object
12 13 14 |
# File 'lib/cantango/license/rules.rb', line 12 def owns(user_account, clazz, ownership_relation = :user_id, user_id_attribute = :id) ability.owns user_account, clazz, ownership_relation, user_id_attribute end |