Skip to content

Commit 1799a49

Browse files
baptistepottierjaviereguiluz
authored andcommitted
Update voters.rst
use constant of class and not string (in twig too)
1 parent 16e475e commit 1799a49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/voters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ code like this:
105105
public function show(Post $post): Response
106106
{
107107
// check for "view" access: calls all voters
108-
$this->denyAccessUnlessGranted('view', $post);
108+
$this->denyAccessUnlessGranted('PostVoter::VIEW', $post);
109109
110110
// ...
111111
}
@@ -114,7 +114,7 @@ code like this:
114114
public function edit(Post $post): Response
115115
{
116116
// check for "edit" access: calls all voters
117-
$this->denyAccessUnlessGranted('edit', $post);
117+
$this->denyAccessUnlessGranted(PostVoter::EDIT, $post);
118118
119119
// ...
120120
}

0 commit comments

Comments
 (0)