php - Symfony's annotations ignored by firewall -
i have accountcontroller.php
file in symfony 2.6.6 works annotations:
<?php use sensio\bundle\frameworkextrabundle\configuration\route; use sensio\bundle\frameworkextrabundle\configuration\method; use sensio\bundle\frameworkextrabundle\configuration\security; /** * @route("/login", name="account_login") * @method({"get", "post"}) */ public function loginaction(request $request) {} /** * @route("/login_check", name="account_login_check") * @method({"post"}) */ public function logincheckaction() {} /** * @route("/logout", name="account_logout") * @method({"get"}) */ public function logoutaction() {} /** * @route("/register", name="account_register") * @method({"get", "post"}) */ public function registeraction(request $request) {}
my access_control in firewall:
access_control: - { path: ^/account/login, roles: is_authenticated_anonymously } - { path: ^/account/register, roles: is_authenticated_anonymously } - { path: ^/account/logout, roles: is_authenticated }
i tried using @security("has_role('is_authenticated')")
on logoutaction when not logged in (anon.) still lets me go page.
is there way lock function @security on right way? firewall needed when using annotations?
thanks.
what this?
- { path: ^/account/logout, roles: is_authenticated_fully }
Comments
Post a Comment