Skip to content

Instantly share code, notes, and snippets.

@jenkoian
Created February 3, 2016 12:58
Show Gist options
  • Save jenkoian/e8a6d4f908c314e8c3f7 to your computer and use it in GitHub Desktop.
Save jenkoian/e8a6d4f908c314e8c3f7 to your computer and use it in GitHub Desktop.
Legacy escape route securityConfigSnippet.php
<?php
// ...
$c->loadFromExtension(
'security',
[
'providers' => [
'legacy' => [
'id' => 'app.legacy_user_provider'
]
],
'encoders' => [
'Acme\\Authentication\\User' => 'plaintext'
],
'firewalls' => [
'main' => [
'pattern' => '^/',
'anonymous' => true,
'logout' => true,
'guard' => [
'authenticators' => [
'app.legacy_authenticator'
],
],
],
],
'access_control' => [
[
'path' => '^/secret/content/only/for/moderators',
'role' => 'ROLE_MODERATOR'
],
]
]
);
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment