security.yml 1.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
security:
    encoders:
        FOS\UserBundle\Model\UserInterface: bcrypt

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN

    providers:
        fos_userbundle:
            id: fos_user.user_provider.username

    firewalls:
        main:
            pattern: ^/
Mat's avatar
Mat committed
16
            anonymous:    true
17 18
            form_login:
                provider: fos_userbundle
19 20
                login_path: fos_user_security_login
                check_path: fos_user_security_check
21 22
                default_target_path: techno_homepage
                use_referer : true
Mat's avatar
Mat committed
23
                csrf_token_generator: security.csrf.token_manager # Use form.csrf_provider instead for Symfony <2.4
24 25 26
            logout:
                path:       fos_user_security_logout
                target:     fos_user_security_login
27 28 29 30 31

    access_control:
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
Mat's avatar
Mat committed
32
        - { path: ^/asso/, role: ROLE_ADMIN }