I've got a wired problem with the symfony 2 security component. Due to the fact that the {{ app.user }}
object is only available within the secured area, I set the firewall pattern to ^/
. Now I want to "unsecured" some pages, like registration. I've tried this by using access_control
but it doesn't work.
Here is my security.yml
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/account/login$
security: false
account_area:
pattern: ^/
form_login:
check_path: /account/login_check
login_path: /account/login
default_target_path: /account
remember_me:
key: blaBlubKey
lifetime: 3600
path: /
domain: ~
logout:
path: /account/logout
target: /
access_control:
#works
- { path: ^/backend, roles: ROLE_USER }
#works not
- { path: ^/registration, roles: IS_AUTHENTICATED_ANONYMOUSLY }
Thanks in advance!