security:
    encoders:
        App\Entity\Auth\User:
            algorithm: auto
    role_hierarchy:
        ROLE_CUSTOMER:       ROLE_USER
        ROLE_ADMIN:       ROLE_CUSTOMER
        ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]



    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        # used to reload user from session & other features (e.g. switch_user)
        app_user_provider:
            entity:
                class: App\Entity\Auth\User
                property: email
        # used to reload user from session & other features (e.g. switch_user)
        # used to reload user from session & other features (e.g. switch_user)
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            user_checker: App\Security\UserCheck
            anonymous: true
            lazy: true
            provider: app_user_provider
            logout:
#                handlers: [app.logout.listener]
                success_handler: App\Security\LogoutSuccessHandler
                path: security_logout
            guard:
                authenticators:
                    - App\Security\AppAuthenticator
            remember_me:
                secret:   '%kernel.secret%'
                lifetime: 604800 # 1 week in seconds
                path:     /
                # by default, the feature is enabled by checking a
                # checkbox in the login form (see below), uncomment the
                # following line to always enable it.
                #always_remember_me: true

            # 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

    # 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 }
        # require ROLE_ADMIN for /admin*


        - { path: ^/admin, role: ROLE_ADMIN }



#        - { path: '^/admin', roles: ROLE_ADMIN }
#
#        # or require ROLE_ADMIN or IS_AUTHENTICATED_FULLY for /admin*
#        - { path: '^/admin', roles: [IS_AUTHENTICATED_FULLY, ROLE_ADMIN] }
#
#        # the 'path' value can be any valid regular expression
#        # (this one will match URLs like /api/post/7298 and /api/comment/528491)
#        - { path: ^/api/(post|comment)/\d+$, roles: ROLE_USER }
