Skip to content

Explaining controllers as viable alternative #13554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 3, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update voters.rst
  • Loading branch information
ThomasLandauer authored Apr 17, 2020
commit 577dfa22ae5b85429430235fb91f9a4528d4489f
5 changes: 2 additions & 3 deletions security/voters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ For more information take a look at
to create the correct response::

// src/AppBundle/Controller/PostController.php
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

// ...

if ($post->getOwner() !== $this->getUser()) {
throw new AccessDeniedException();
throw $this-> createAccessDeniedException();
}

The Voter Interface
Expand Down