1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Fix security.context deprecation

This commit is contained in:
Jeremy Benoist 2015-11-07 00:17:37 +01:00
parent 5ead137fe6
commit 18f8f32f70
4 changed files with 12 additions and 12 deletions

View file

@ -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());
}