aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-11-07 00:17:37 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-11-07 00:17:37 +0100
commit18f8f32f70a3f76b307f4255eee0f51187b07283 (patch)
tree0d81173a7e58dfff2e018327a60391e77292dfa8 /src/Wallabag/ApiBundle/Controller
parent5ead137fe6885395ffcc99903263dec235f2c051 (diff)
downloadwallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.tar.gz
wallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.tar.zst
wallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.zip
Fix security.context deprecation
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller')
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php4
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 }