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

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

    providers:
        fos_userbundle:
            id: fos_user.user_provider.username

    firewalls:
        main:
            pattern: ^/
            form_login:
                provider: fos_userbundle
                csrf_parameter: _csrf_token
                default_target_path:  admin

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

            http_basic: ~
        api_doc:
            pattern: ^/api/doc
            security: false

    access_control:
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, role: ROLE_ADMIN }
        - { path: ^/resetting, role: ROLE_ADMIN }
        - { path: ^/admin, role: ROLE_USER }
        - { path: ^/accueil, role: ROLE_ADMIN }
        - { path: ^/map, role: ROLE_USER }
        - { path: ^/salon, role: ROLE_USER }
        - { path: ^/device_index, role: ROLE_USER }
        - { path: ^/totem_index, role: ROLE_USER }
