security:
    password_hashers:
        App\Entity\User:
            algorithm: auto
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        our_db_provider:
            entity:
                class: App\Entity\User
                # property: username
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            #pattern:    ^/
            provider: our_db_provider
            form_login:
                login_path: login
                check_path: login
                default_target_path: start
            logout:
                path:   /logout
                target: start
            remember_me:
                secret:   '%kernel.secret%'
            lazy:   true

            # 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
    
    role_hierarchy:
        ROLE_ADMIN: ROLE_USER

    # 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, roles: PUBLIC_ACCESS }
        - { path: ^/reset-password, roles: PUBLIC_ACCESS }
        - { path: ^/apartments/calendar, roles: PUBLIC_ACCESS }
        - { path: ^/reservation/*, roles: [ROLE_RESERVATIONS_RO, ROLE_USER]}
        - { path: ^/users, roles: ROLE_ADMIN }
        - { path: ^/logout, roles: IS_AUTHENTICATED }
        - { path: ^/, roles: ROLE_USER }
        