Réalisation finale
This commit is contained in:
@@ -4,17 +4,26 @@ security:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||
providers:
|
||||
users_in_memory: { memory: null }
|
||||
app_user_provider:
|
||||
entity:
|
||||
class: App\Entity\Membre
|
||||
property: email
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
lazy: true
|
||||
provider: users_in_memory
|
||||
provider: app_user_provider
|
||||
|
||||
# activate different ways to authenticate
|
||||
# https://symfony.com/doc/current/security.html#the-firewall
|
||||
form_login:
|
||||
login_path: app_login
|
||||
check_path: app_login
|
||||
username_parameter: email
|
||||
password_parameter: password
|
||||
logout:
|
||||
path: app_logout
|
||||
target: app_home
|
||||
|
||||
# https://symfony.com/doc/current/security/impersonating_user.html
|
||||
# switch_user: true
|
||||
@@ -22,8 +31,15 @@ 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 }
|
||||
# pages publiques
|
||||
- { path: ^/login$, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/_profiler, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/_wdt, roles: PUBLIC_ACCESS }
|
||||
# pages sécurisées
|
||||
- { path: ^/admin, roles: ROLE_ADMIN }
|
||||
- { path: ^/projet, roles: ROLE_DEV }
|
||||
# tout le reste nécessite d'être authentifié
|
||||
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
|
||||
|
||||
when@test:
|
||||
security:
|
||||
|
||||
Reference in New Issue
Block a user