Sfoglia il codice sorgente

Hiding group with on_top when no items to show (#4457)

Hiding menuItem with setDisplay(false) when user has no permissions or no list
action exists because otherwise user without permissions see items without links
Alexander N 8 anni fa
parent
commit
c8778aa88e
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      Menu/Provider/GroupMenuProvider.php

+ 2 - 1
Menu/Provider/GroupMenuProvider.php

@@ -147,8 +147,9 @@ class GroupMenuProvider implements MenuProviderInterface
                 if (isset($item['admin']) && !empty($item['admin'])) {
                     $admin = $this->pool->getInstance($item['admin']);
 
-                    // skip menu item if no `list` url is available or user doesn't have the LIST access rights
+                    // Do not display group if no `list` url is available or user doesn't have the LIST access rights
                     if (!$admin->hasRoute('list') || !$admin->hasAccess('list')) {
+                        $menuItem->setDisplay(false);
                         continue;
                     }