security:
    encoders:
        UserBundle\Entity\User: sha512

    role_hierarchy:
        ROLE_EXPERT: ROLE_USER
        ROLE_ADMIN: ROLE_EXPERT
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
        
    providers:
        in_memory:
            memory: ~
        fos_userbundle:
            id: fos_user.user_provider.username_email

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            pattern:   ^/
            form_login:
                provider: fos_userbundle
                check_path: fos_user_security_check
                login_path: /connexion
                csrf_token_generator: security.csrf.token_manager
                remember_me: true
                always_use_default_target_path: false
                use_referer: true
            remember_me:
                secret:   '%env(APP_SECRET)%'
                #secret: 'toto'
                lifetime: 604800
            logout:
                path:    /se-deconnecter
                target:   core_home
            anonymous:  true

    #access_control:
        # - { path: ^/connexion, role: IS_AUTHENTICATED_ANONYMOUSLY }
        # - { path: ^/inscription, role: IS_AUTHENTICATED_ANONYMOUSLY }
        # - { path: ^/reinitialiser, role: IS_AUTHENTICATED_ANONYMOUSLY }
        # - { path: ^/odera/systeme/ov, role: ROLE_EXPERT }
        # - { path: ^/odera/, role: ROLE_USER }
        # - { path: ^/odera/systeme/ov, role: ROLE_EXPERT }
        # - { path: ^/ovv/, role: ROLE_USER}
        # - { path: ^/admin/, role: ROLE_ADMIN }