How to override Symfony's security for a specific environment?
By disabling the firewalls, authentication is disabled, so users cannot authenticate with your app.
But authorization (security.access_control
) is still active. So users still need to get a role to access these paths, and have no way to acquire the role.
You would need to define different access_control
rules for each environment, on top of changing firewall settings.
You cannot override security.access_control
settings in different files You would get an error saying this if you attempt to do so:
Configuration path "security.access_control" cannot be overwritten. You have to define all options for this path, and any of its sub-paths in one configuration section.
So you'll probably need to have different security.yaml
files for each environment, defining all the necessary access control rules.