Reputation: 3226
I could not find this in symfony2 docs so I'm asking here. Is it possible to set path names instead of patterns inside security.yml
access_controll
?
Instead of:
access_control:
- { path: /admin/logowanie, roles: IS_AUTHENTICATED_ANONYMOUSLY }
set it like this:
access_control:
- { path: pkr_blog_user_login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
Path name is correct but at the moment second form does not work . How can I make it work?
Upvotes: 0
Views: 359
Reputation: 29932
I don't think that you can do something like this.
What you can do is to secure a controller that is pretty much like what you're trying to do here, as a controller (action) will be invoked by a particular route and even if you change route name, is supposed that you have to pass through the same controller action.
In that way you can have the flexibility that you're searching for.
Upvotes: 1