protected function resolveConditions($conditions,
$condition_logic) { foreach ($conditions as $condition) { try { $pass =
$condition->
execute();
} catch (ContextException
$e) { // If a condition is missing context and is not negated, consider that a
// fail.
$pass =
$condition->
isNegated();
} // If a condition fails and all conditions were needed, deny access.
if (!
$pass &&
$condition_logic == 'and'
) { return FALSE;
} // If a condition passes and only one condition was needed, grant access.
elseif ($pass &&
$condition_logic == 'or'
) { return TRUE;
} }