
security:
#    providers:
#        fos_userbundle:
#            id: fos_user.user_manager
    providers:
        fos_userbundle:
            id: fos_user.user_provider.username_email 
        
    encoders:
        FOS\UserBundle\Model\UserInterface: bcrypt
    firewalls:
        main:
            pattern: ^/
            provider: main
            form_login:
                provider: fos_userbundle
                csrf_provider: form.csrf_provider
                login_path: fos_user_security_login
                check_path: fos_user_security_check
                success_handler: redirect.after.login
            logout:
                path: fos_user_security_logout
                target: /login
                success_handler: redirect.after.logout
            remember_me:
                key: %secret%
            anonymous: true
                
                
    #c'est ici que tout se passe : qui a accés à quoi?
    access_control:
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin/, role: [ROLE_ADMIN]}
        - { path: ^/editor/, role: [ROLE_EDITOR,ROLE_ADMIN]}
        - { path: ^/author/, role: [ROLE_AUTHOR,ROLE_EDITOR,ROLE_ADMIN,ROLE_REVIEWER]}
        - { path: ^/reviewer/, role: [ROLE_REVIEWER,ROLE_AUTHOR,ROLE_EDITOR,ROLE_ADMIN]}
        
        
       
    role_hierarchy:
        ROLE_ADMIN: [ROLE_USER, ROLE_DIRECTEUR, ROLE_OPERATRICE]
        ROLE_USER_ADMIN: [ROLE_USER, ROLE_DIRECTEUR, ROLE_OPERATRICE, ROLE_ADMIN]
      
        
        
        
         
