By recording the user voter and registering as a service (the first user voter in the project), Tested with:
public function deleteAction(Product $product)
{
if (!$this->get('security.context')->isGranted("PRODUCT_DELETE", $product)) {
throw new \Exception('ACCESS DENIED');
}
}
And it works as expected. Nonetheless,
public function deleteAction(Product $product)
{
}
Regardless of the SecureParam annotation, the voter receives a call with the following parameters:
$attributes = ["ROLE_USER"];
$object instanceof \Symfony\Component\HttpFoundation\Request
I'm banging my head on the wall at the moment ...
source
share