浏览代码

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 年之前
父节点
当前提交
534b7693fe
共有 1 个文件被更改,包括 1 次插入1 次删除
  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>