Skip to content

Commit

Permalink
[#3512157] Added better access check on local task links.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardgaunt committed Mar 11, 2025
1 parent 944cc2e commit 3e75243
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/themes/contrib/civictheme/includes/local_tasks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
declare(strict_types=1);

use Drupal\civictheme\CivicthemeConstants;
use Drupal\Core\Access\AccessResultInterface;

/**
* Pre-process for local tasks.
Expand All @@ -19,7 +20,7 @@ function _civictheme_preprocess_menu_local_tasks(array &$variables): void {
foreach ($local_task_types as $local_task_type) {
$variables['links'][$local_task_type] = [];
foreach ($variables[$local_task_type] as $link) {
if (!empty($link['#access']) && $link['#access']->isAllowed()) {
if (!empty($link['#access']) && ($link['#access'] === TRUE || ($link['#access'] instanceof AccessResultInterface && $link['#access']->isAllowed()))) {
$variables['links'][$local_task_type][] = [
'theme' => $context_theme,
'text' => $link['#link']['title'],
Expand Down

0 comments on commit 3e75243

Please sign in to comment.