Assetic files in symfony are behind the firewall?

家住魔仙堡 提交于 2019-12-05 10:39:03

This is normal. You are saying that everything under the root dir (pattern: ^/) is behind the main firewall and that to access these files you need to be an admin (path: ^/, role: ROLE_ADMIN). So you need to set another rule and say that the css directory can be accessed anonymously:

- { path: ^/css, role: IS_AUTHENTICATED_ANONYMOUSLY }
Bartosz Rychlicki

Also I've found that this helps if added to security.yml:

firewalls:
    dev:
        pattern:    ^/(_profiler|_wdt|css|js|assets)
        security:   false
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!