security: encoders: App\Entity\User: sha512 # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers role_hierarchy: ROLE_ADMIN: [ROLE_USER, ROLE_MODERATEUR] ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded providers: main: entity: class: App\Entity\User property: username firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: anonymous: ~ user_checker: App\Security\UserChecker guard: authenticators: - App\Security\LoginFormAuthenticator remember_me: secret: '%env(APP_SECRET)%' logout: path: app_logout target: app_login # activate different ways to authenticate # http_basic: true # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate # form_login: true # https://symfony.com/doc/current/security/form_login_setup.html # 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: ^/(login$|register$|motdepasseoublie$|resetpassword/token=|activate/token=|fichefilm/|$|liste-by/|liste-by_real/|recherche) , roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/admin, roles: ROLE_ADMIN } - { path: ^/genre, roles: ROLE_MODERATEUR } - { path: ^/, roles: IS_AUTHENTICATED_REMEMBERED }