security:
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext
        EPS\CoreBundle\Entity\AccesUtilisateur: bcrypt
        
    providers:
        chain_provider:
            chain:
                providers: [in_memory, dbaccesutil_provider]
        in_memory:
            memory: 
                users:
                    superadmin: { password: b123456bv2, roles: [ 'ROLE_SUPER_ADMIN' ] }
#                    sdv: { password: gtH76Dfr, roles: [ 'ROLE_SUPER_ADMIN' ] }
        dbaccesutil_provider:
             entity:
                 class: EPSCoreBundle:AccesUtilisateur
                 property: email

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]            

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
            
        coreadminz:
            pattern: ^/coreadminz
            form_login:
                provider: chain_provider
                login_path:  coreadminzlogin
                check_path:  coreadminzlogin_checkz
                csrf_provider: security.csrf.token_manager
                default_target_path: /coreadminz
            logout:
                path:   /coreadminz/logoutz
                target: /coreadminz
            anonymous:    true

        default:
            pattern: ^/
            anonymous: ~
            
    access_control:
        - { path: ^/coreadminz/loginz$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/coreadminz, role: ROLE_SUPER_ADMIN }
        - { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }
