security:
    # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
    password_hashers:
        Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
    # https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
    providers:
        # used to reload user from session & other features (e.g. switch_user)
        app_user_provider:
            entity:
                class: App\Entity\User
                property: email
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            lazy: true
            provider: app_user_provider
            custom_authenticator: App\Security\LoginFormAuthenticator
            logout:
                path: app_logout
                target: app_home

            remember_me:
                secret: '%kernel.secret%'
                lifetime: 604800
                path: /
                # by default, the feature is enabled by checking a checkbox in the
                # login form, uncomment the following line to always enable it.
                # always_remember_me: true


    access_control:
        - { path: ^/planing, roles: ROLE_DOCTOR }
        - { path: ^/appointment, roles: ROLE_PATIENT }
        - { path: ^/review, roles: ROLE_PATIENT }
        - { path: ^/messaging, roles: ROLE_PATIENT }
        - { path: ^/admin, roles: ROLE_ADMIN }
     

    role_hierarchy:
        ROLE_PATIENT:      ROLE_USER
        ROLE_DOCTOR: [ROLE_USER, ROLE_PATIENT]
        ROLE_ADMIN: [ROLE_USER, ROLE_PATIENT, ROLE_DOCTOR]
