symfony - symfony2 access control on assets -


for reason ( angularjs top secret js files ) need put behind firewall resources. don't know how setup symfony way. tried set access_control on /web/myresources.js kernel not handle it.

i'd :

- { path: ^/assets/admin/, role: role_admin } 

to protect, example : "/assets/admin/js/app.js".

any ideas ? thank you.

edit : created bundle achieve that. not documented yet, here repo :

https://github.com/nathanvss/resources-firewall-bundle

symfony firewall can work on uris managed symfony. assets static files , not routed through symfony.

use web server config protect such routes. instance, protecting directory index listings in apache:

create .htaccess file following:

options -indexes 

or disabling autoindex in nginx:

syntax:  autoindex on | off; default: autoindex off; context: http, server, location 

enables or disables directory listing output.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -