Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Optim: Add user permissions and roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayoshi-dev committed May 27, 2020
2 parents f518071 + 5bee5e9 commit aecaa0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ security:
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
- { path: ^/dashboard, roles: ROLE_USER }
- { path: ^/admin, roles: ROLE_ADMIN }
9 changes: 5 additions & 4 deletions templates/partials/menu.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@
<li class="nav-item">
<a class="nav-link text-dark" href="#"><i class="far fa-chart-bar mr-2"></i>Statistiques</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="{{ path('admin.listeUtilisateur') }}"><i class="fas fa-users mr-2"></i>Utilisateurs</a>
</li>
{% if is_granted('ROLE_ADMIN') %}
<li class="nav-item">
<a class="nav-link text-dark" href="{{ path('admin.listeUtilisateur') }}"><i class="fas fa-users mr-2"></i>Utilisateurs</a>
</li>
{% endif %}
</ul>


<!-- Contenus "Infos Personelles" -->
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-5 mb-2 text-muted">
<span>Infos personnelles</span>
Expand Down

0 comments on commit aecaa0f

Please sign in to comment.