// If any context is missing then we might be missing cacheable
// metadata, and don't know based on what conditions the block is
// accessible or not. Make sure the result cannot be cached.
$access = AccessResult::
forbidden()->
setCacheMaxAge(0
);
} elseif ($missing_value) { // The contexts exist but have no value. Deny access without
// disabling caching. For example the node type condition will have a
// missing context on any non-node route like the frontpage.
$access = AccessResult::
forbidden();
} elseif ($this->
resolveConditions($conditions, 'and'
) !== FALSE
) { // Delegate to the plugin.
$block_plugin =
$entity->
getPlugin();
try { if ($block_plugin instanceof ContextAwarePluginInterface
) { $contexts =
$this->contextRepository->
getRuntimeContexts(array_values($block_plugin->
getContextMapping()));
$this->contextHandler->
applyContextMapping($block_plugin,
$contexts);
} $access =
$block_plugin->
access($account, TRUE
);
} catch (MissingValueContextException
$e) { // The contexts exist but have no value. Deny access without