File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -192,18 +192,14 @@ from the security context is called.
192
192
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
193
193
use Symfony\Component\HttpFoundation\Response;
194
194
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
195
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
196
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
197
- use Acme\DemoBundle\Entity\Post;
198
195
199
196
class PostController extends Controller
200
197
{
201
- /**
202
- * @Route("/blog/{id}")
203
- * @ParamConverter("post", class="SensioBlogBundle:Post")
204
- */
205
- public function showAction(Post $post)
198
+ public function showAction()
206
199
{
200
+ // get a Post instance
201
+ $post = ...;
202
+
207
203
// keep in mind, this will call all registered security voters
208
204
if (false === $this->get('security.context')->isGranted('view', $post)) {
209
205
throw new AccessDeniedException('Unauthorised access!');
You can’t perform that action at this time.
0 commit comments