security:
    encoders:
        FOS\UserBundle\Model\UserInterface: bcrypt
        UserBundle\Entity\User: bcrypt

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN

    providers:
        fos_userbundle:
            id: fos_user.user_provider.username_email

    firewalls:
        main:
            pattern: ^/
            form_login:
                provider: fos_userbundle
                csrf_token_generator: security.csrf.token_manager
                success_handler: redirect.after.login

            logout:
                path: fos_user_security_logout
                target: /login
            anonymous:    true

    access_control:
            - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/register, role: ROLE_ADMIN}
            - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/admin/, role: ROLE_ADMIN }
            - { path: ^/chefprojet/, role: ROLE_USER_CP }
            - { path: ^/chargecompte/, role: ROLE_USER_CC }
            - { path: ^/clientrepresentant/, role: ROLE_USER_R }
            - { path: ^/clientacheteur/, role: ROLE_USER_A }
            - { path: ^/clientdemandeur/, role: ROLE_USER_D }