Przeglądaj źródła

The Dashboard is not usign the role hierarchy

Luciano Andrade 13 lat temu
rodzic
commit
801c7d7496
1 zmienionych plików z 1 dodań i 5 usunięć
  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 %}