소스 검색

The Dashboard is not usign the role hierarchy

Luciano Andrade 13 년 전
부모
커밋
801c7d7496
1개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 5
      Resources/views/standard_layout.html.twig

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

@@ -89,11 +89,7 @@ file that was distributed with this source code.
                                     {# There is no hasRole in a TokenInterface ... #}
                                     {% set allowed = false %}
                                     {% if app.security %}
-                                        {% for role in app.security.token.roles %}
-                                            {% if not allowed %}
-                                                {% set allowed = role.role == 'ROLE_SONATA_ADMIN' %}
-                                            {% endif %}
-                                        {% endfor %}
+                                    {% set allowed = is_granted('ROLE_SONATA_ADMIN') %}
                                     {% endif %}
 
                                     {% if allowed %}