Last active
March 21, 2016 11:06
-
-
Save jenkoian/3f38b15298517f99e07b to your computer and use it in GitHub Desktop.
Symfony access control example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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