Method: Can4::Ability#can

Defined in:
lib/can4/ability.rb

#can(action, subject, &block) ⇒ Object

Adds an access-granting rule.

Parameters:

  • action (Symbol)

    The action, represented as a symbol.

  • subject (Object)

    The subject.

  • block (Proc)

    An optional Proc to install for matching.



57
58
59
# File 'lib/can4/ability.rb', line 57

def can(action, subject, &block)
  rule_for(subject).add_grant(action, block)
end