Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 577dfa2

Browse files
Update voters.rst
See #13554 (comment)
1 parent fdfd1ad commit 577dfa2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

security/voters.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ For more information take a look at
4040
to create the correct response::
4141

4242
// src/AppBundle/Controller/PostController.php
43-
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
44-
4543
// ...
44+
4645
if ($post->getOwner() !== $this->getUser()) {
47-
throw new AccessDeniedException();
46+
throw $this-> createAccessDeniedException();
4847
}
4948

5049
The Voter Interface

0 commit comments

Comments
 (0)