Bladeren bron

Verifying that the token exists prior to using is_granted to prevent the check in case there is no security context in the request.

Aitor Suso 13 jaren geleden
bovenliggende
commit
534b7693fe
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      Resources/views/standard_layout.html.twig

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

@@ -79,7 +79,7 @@ file that was distributed with this source code.
 
                         <ul class="nav">
                             {% block top_bar_before_nav %} {% endblock %}
-                            {% if app.security and is_granted('ROLE_SONATA_ADMIN') %}
+                            {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
                                 {% for group in admin_pool.dashboardgroups %}
                                     <li class="dropdown">
                                         <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ group.label|trans({}, group.label_catalogue) }} <span class="caret"></span></a>