Allow anonymous access to specific URL in Symfony firewall protected bundle
问题 I have a Symfony bundle which can only be accessible by using mydomain.com/box To access /box you must be logged in, however i would like to enable anonymous access into mydomain.com/box/download # Security.yml access_control: - { path: ^/box , roles: ROLE_USER} How can i do ? 回答1: # security.yml access_control: - { path: ^/box/download , roles: IS_AUTHENTICATED_ANONYMOUSLY} - { path: ^/box , roles: ROLE_USER} Symfony2 firewalls are processed in order, and only first matching one will be