From 18f8f32f70a3f76b307f4255eee0f51187b07283 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 7 Nov 2015 00:17:37 +0100 Subject: Fix security.context deprecation --- src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/ApiBundle/Controller') diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 1fee56ad..74bfe4dc 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -40,7 +40,7 @@ class WallabagRestController extends FOSRestController private function validateAuthentication() { - if (false === $this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')) { + if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { throw new AccessDeniedException(); } } @@ -347,7 +347,7 @@ class WallabagRestController extends FOSRestController */ private function validateUserAccess($requestUserId) { - $user = $this->get('security.context')->getToken()->getUser(); + $user = $this->get('security.token_storage')->getToken()->getUser(); if ($requestUserId != $user->getId()) { throw $this->createAccessDeniedException('Access forbidden. Entry user id: '.$requestUserId.', logged user id: '.$user->getId()); } -- cgit v1.2.3