diff options
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/WallabagRestController.php')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
40 | 40 | ||
41 | private function validateAuthentication() | 41 | private function validateAuthentication() |
42 | { | 42 | { |
43 | if (false === $this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')) { | 43 | if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { |
44 | throw new AccessDeniedException(); | 44 | throw new AccessDeniedException(); |
45 | } | 45 | } |
46 | } | 46 | } |
@@ -347,7 +347,7 @@ class WallabagRestController extends FOSRestController | |||
347 | */ | 347 | */ |
348 | private function validateUserAccess($requestUserId) | 348 | private function validateUserAccess($requestUserId) |
349 | { | 349 | { |
350 | $user = $this->get('security.context')->getToken()->getUser(); | 350 | $user = $this->get('security.token_storage')->getToken()->getUser(); |
351 | if ($requestUserId != $user->getId()) { | 351 | if ($requestUserId != $user->getId()) { |
352 | throw $this->createAccessDeniedException('Access forbidden. Entry user id: '.$requestUserId.', logged user id: '.$user->getId()); | 352 | throw $this->createAccessDeniedException('Access forbidden. Entry user id: '.$requestUserId.', logged user id: '.$user->getId()); |
353 | } | 353 | } |