Skip to content

Instantly share code, notes, and snippets.

@jenkoian
Last active March 21, 2016 11:06
Show Gist options
  • Save jenkoian/3f38b15298517f99e07b to your computer and use it in GitHub Desktop.
Save jenkoian/3f38b15298517f99e07b to your computer and use it in GitHub Desktop.
Symfony access control example
<?php
//...
$container->loadFromExtension(‘security’, [
//...
‘access_control’ => [
[‘path’ => ‘^/content/add’, ‘role’ => ‘ROLE_EDITOR’],
[‘path’ => ‘^/content/moderate’, ‘role’ => ‘ROLE_MODERATOR’],
[‘path’ => ‘^/user/edit’, ‘role’ => ‘ROLE_ADMIN’]
],
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment