This can be done according to Documentaion.
https://github.com/schmittjoh/JMSSecurityExtraBundle/issues/50
Tip. If you like to protect all controller actions with the same rule, you can also specify @PreAuthorize for the class itself. precaution though this rule applies only to methods that are declared in the class.
use JMS\SecurityExtraBundle\Annotation\PreAuthorize; class MyService { public function secureMethod() {
source share