File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,8 @@ edit a particular object. Here's an example implementation:
105105
106106 break;
107107 case self::EDIT:
108- // we assume that our data object has a method getOwner() to
109- // get the current owner user entity for this data object
108+ // this assumes that the data object has a getOwner() method
109+ // to get the entity of the user who owns this data object
110110 if ($user->getId() === $post->getOwner()->getId()) {
111111 return true;
112112 }
@@ -214,9 +214,7 @@ from the authorization checker is called.
214214
215215 $authChecker = $this->get('security.authorization_checker');
216216
217- if (false === $authChecker->isGranted('view', $post)) {
218- throw $this->createAccessDeniedException('Unauthorized access!');
219- }
217+ $this->denyAccessUnlessGranted('view', $post, 'Unauthorized access!');
220218
221219 return new Response('<h1 >'.$post->getName().'</h1 >');
222220 }
You can’t perform that action at this time.
0 commit comments