security:
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    encoders:
        App\Entity\User: bcrypt
        App\Entity\Staff: bcrypt
    providers:
        from_database:
            entity:
                #class: App\Entity\User
                class: App\Entity\Staff
    firewalls:
        secured_area:
            pattern: ^/
            anonymous: true
            guard:
                authenticators:
                    #- App\Security\SigninJsonUserAuthenticator
                    - App\Security\SigninJsonStaffAuthenticator
            logout:
                #path: logout
                #target: login
                path: signout
                target: signin
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            anonymous: lazy
            json_login:
                check_path: signin
            provider: from_database

            # activate different ways to authenticate
            # https://symfony.com/doc/current/security.html#firewalls-authentication

            # https://symfony.com/doc/current/security/impersonating_user.html
            # switch_user: true
    role_hierarchy:
        ROLE_USER:       [ROLE_USER]       # Un admin hérite des d
        ROLE_EDITOR:       [ROLE_EDITOR]       # Un admin hérite des d
        ROLE_MANAGER:       [ROLE_MANAGER]       # Un admin hérite des d
        ROLE_SUPERVISOR:       [ROLE_SUPERVISOR]       # Un admin hérite des d
    # 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: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        # - { path: ^/list-category, roles: ROLE_TOTO }
        # - { path: ^/list-category, roles: [ROLE_TOTO, IS_AUTHENTICATED_ANONYMOUSLY] }