我正在尝试使用注释来保护我的控制器:
namespace Vinny\StreamBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use JMS\SecurityExtraBundle\Annotation\Secure;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class HomeController extends Controller
{
/**
* @Route("/home", name="home")
* @Secure(roles="ROLE_USER")
*/
public function indexAction()
{
...
Run Code Online (Sandbox Code Playgroud)
但我似乎无法让我的控制器实际上受到保护.是否有任何可以忽略的情况?