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

    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_provider: form.csrf_provider
            logout:       true
            anonymous:    true
            form_login:
                #success_handler: security.authentication.customized_success_handler
                use_referer:        true
            logout:
                path:   /logout
                target: /

    access_control:
        - { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/resetting, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin/, roles: ROLE_ADMIN }
        - { path: ^/audience/, roles: ROLE_ADMIN }
        - { path: ^/customer/, roles: [ROLE_MEMBER, ROLE_RENTAL_MEMBER, ROLE_ECARE_MEMBER, ROLE_BUSINESS_PARTNER, ROLE_RESORT_OWNER] }
        - { path: ^/suggest_images/, roles: [ROLE_RESORT_OWNER, ROLE_ADMIN] }
        - { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY }

