瀏覽代碼

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 年之前
父節點
當前提交
c8778aa88e
共有 1 個文件被更改,包括 2 次插入1 次删除
  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;
                     }