lib/cantango/permission_engine/evaluator.rb in cantango-0.9.3.2 vs lib/cantango/permission_engine/evaluator.rb in cantango-0.9.4
- old
+ new
@@ -1,8 +1,10 @@
module CanTango
class PermissionEngine < Engine
class Evaluator
+ include CanTango::Helpers::Debug
+
attr_reader :ability, :rule
include CanTango::Rules
def initialize ability, rule
@@ -10,9 +12,12 @@
@rule = rule
safe_rules!
end
def evaluate! user
+ debug "Evaluating rule:"
+ debug rule.can
+ debug rule.cannot
@user = user
instance_eval rule.can if rule.can?
instance_eval rule.cannot if rule.cannot?
end