Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5794371

Browse filesBrowse files
MarcomTeamweaverryan
authored andcommitted
Update voters_data_permission.rst
agreed
1 parent be94cf7 commit 5794371
Copy full SHA for 5794371

File tree

Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed

‎cookbook/security/voters_data_permission.rst

Copy file name to clipboardExpand all lines: cookbook/security/voters_data_permission.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,8 @@ from the security context is called.
207207
public function showAction($id)
208208
{
209209
// get a Post instance
210-
$post = $this->getDoctrine()
211-
->getRepository('AcmeStoreBundle:Post')
212-
->find($id);
213-
210+
$post = ...;
211+
214212
// keep in mind, this will call all registered security voters
215213
if (false === $this->get('security.context')->isGranted('view', $post)) {
216214
throw new AccessDeniedException('Unauthorised access!');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.