Commit 15bb6e1e authored by http://jneen.net/'s avatar http://jneen.net/

more eagerly bail when the state is prevented

parent 8a167554
......@@ -76,6 +76,8 @@ module DeclarativePolicy
@state = State.new
steps_by_score do |step, score|
return if !debug && @state.prevented?
passed = nil
case step.action
when :enable then
......@@ -93,10 +95,7 @@ module DeclarativePolicy
# been prevented.
unless @state.prevented?
passed = step.pass?
if passed
@state.prevent!
return unless debug
end
@state.prevent! if passed
end
debug << inspect_step(step, score, passed) if debug
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment