Skip to content

Commit 25a1a94

Browse files
committed
Tweaks
1 parent 514482c commit 25a1a94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

security/voters.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,15 @@ code like this:
9898
// src/Controller/PostController.php
9999
100100
// ...
101+
use App\Security\PostVoter;
101102
102103
class PostController extends AbstractController
103104
{
104105
#[Route('/posts/{id}', name: 'post_show')]
105106
public function show(Post $post): Response
106107
{
107108
// check for "view" access: calls all voters
108-
$this->denyAccessUnlessGranted('PostVoter::VIEW', $post);
109+
$this->denyAccessUnlessGranted(PostVoter::VIEW, $post);
109110
110111
// ...
111112
}

0 commit comments

Comments
 (0)