module Minican::ControllerAdditions
Private Class Methods
included(base)
click to toggle source
# File lib/minican/controller_additions.rb, line 65 def self.included(base) base.helper_method :can? base.helper_method :cannot? end
Private Instance Methods
can?(method, object, user = current_user)
click to toggle source
Helper method available in controllers and views that returns the value of the policy method
@param (see authorize!
) @return (Boolean)
@visibility public
# File lib/minican/controller_additions.rb, line 49 def can?(method, object, user = current_user) policy = policy_for(object) policy.can?(method, user) end
cannot?(method, object, user = current_user)
click to toggle source