I was trying to evaluate the best among JMSSecurityExtraBundle and SensioFrameworkExtraBundle. First is a popular security bundle and the other listed in symfony2 website.
While both provide the annotations to secure the methods of a controller via @Secure
in JMS and @Security
in Sensio, JMS security bundle provides more security options See here
I would like to ask the community which is the best bundle for Symfony 2.4
The
@Security
annotation was added toSensioFrameworkExtraBundle
in version2.4
of the bundle !That means it does NOT work with a Symfony version < 2.4 because this version of the bundle requires the
ExpressionLanguage
component that was added in Symfony 2.4 to work.Have a look at the bundle's composer.json.
Further the
@Security
annotation only works for controller classes because the check is performed in a subscriber that listens for thekernel.controller
event.The
JMSSecurityExtraBundle
can be configured to work with all defined services (not just controller classes). Further it ...is_expr_granted
twig function for symfony versions < 2.4)Hope that clarifies it a bit.