فهرست منبع

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 %}