symfony - FOSUserBundle allow access to whole site -


guys! i'am trying configure user system (fosuserbundle) symfony app. going ok until tried allow access whole site , restrict access routes using access control in security configuration file.

firewalls:     main:         pattern: ^/         form_login:             provider: fos_userbundle             csrf_provider: form.csrf_provider             default_target_path: /         logout:       true         anonymous:    true  access_control:      - { path: ^/$, roles: is_authenticated_anonymously }     - { path: ^/profile$, roles: role_user }     - { path: ^/admin$, roles: role_admin } 

i've tried also

# - { path: ^/.*, roles: is_authenticated_anonymously } #

and when go index page (/), redirects me login page. want have index page visible visitors, not logged in.

just can't figure out moment. thank answers.

try this:

access_control:     - { path: ^/profile$, roles: role_user }     - { path: ^/admin$, roles: role_admin }     - { path: ^/, roles: is_authenticated_anonymously } 

Popular posts from this blog