Use klaro settings for excluded paths in block settings and add cache for render array
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3335275. -->
Reported by: [erik seifert](https://www.drupal.org/user/161429)
Related to !13
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>As a site builder, i want to place a klaro block going side by side with klaro settings. If i set exclude_paths in klaro configuration, the block should also not displayed on these paths. </p>
<p>As you see in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/simple_klaro/-/work_items/3335246" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/simple_klaro/-/work_items/3335246</a></span> the test testExcludePaths will fail because it tests also the block visibility. </p>
<p>Caching seems also not respected. So if you change the title in klaro_settings and revisit the site with an anonymous user, title stays the same.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Set klaro block in a region. Exclude a path in klaro settings. Go to the url and the block is still present and not functional.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Use klaro settings in Block::blockAccess . Add the cache dependencies on block and library rendering.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue