We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d13dce3 commit cb9660aCopy full SHA for cb9660a
security/expressions.rst
@@ -34,6 +34,23 @@ and ``#[IsGranted()]`` attribute also accept an
34
// ...
35
}
36
37
+ .. code-block:: php-attributes
38
+
39
+ // src/Controller/MyController.php
40
+ namespace App\Controller;
41
42
+ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
43
+ use Symfony\Component\ExpressionLanguage\Expression;
44
+ use Symfony\Component\HttpFoundation\Response;
45
46
+ class MyController extends AbstractController
47
+ {
48
+ #[IsGranted(new Expression('is_granted("ROLE_ADMIN") or is_granted("ROLE_MANAGER")'))]
49
+ public function index(): Response
50
51
+ // ...
52
+ }
53
54
55
.. code-block:: php
56
0 commit comments