فهرست منبع

Only show items in the dropdown menu if either create or list action is available and granted.

Michel Weimerskirch 13 سال پیش
والد
کامیت
241bafe51e
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      Resources/views/standard_layout.html.twig

+ 3 - 1
Resources/views/standard_layout.html.twig

@@ -90,7 +90,9 @@ file that was distributed with this source code.
                                             <a href="#" class="dropdown-toggle">{{ group.label|trans({}, 'SonataAdminBundle') }}</a>
                                             <ul class="dropdown-menu">
                                                 {% for admin in group.items %}
-                                                    <li><a href="{{ admin.generateUrl('list')}}">{{ admin.label|trans({}, admin.translationdomain) }}</a></li>
+                                                    {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}
+                                                        <li><a href="{{ admin.generateUrl('list')}}">{{ admin.label|trans({}, admin.translationdomain) }}</a></li>
+                                                    {% endif %}
                                                 {% endfor %}
                                             </ul>
                                         </li>