diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2015-11-07 13:39:30 +0100 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2015-11-07 13:39:30 +0100 |
commit | 4529d0f4b6b20cbbd1ccb5339a753aff7d35552b (patch) | |
tree | 84724eea1cef0c6d44afbb850d939367921a230c /src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |
parent | 3d9ccf9390f35e73428ebf42258253c6808f1590 (diff) | |
parent | 164d260c498a74b6b97a17dd63f9dd6088702ebc (diff) | |
download | wallabag-4529d0f4b6b20cbbd1ccb5339a753aff7d35552b.tar.gz wallabag-4529d0f4b6b20cbbd1ccb5339a753aff7d35552b.tar.zst wallabag-4529d0f4b6b20cbbd1ccb5339a753aff7d35552b.zip |
Merge pull request #1510 from wallabag/v2-sf3
v2 – Fix some deprecated for Symfony3
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 | } |