Skip to content

Commit 99021ba

Browse files
committed
5.0
1 parent 9c142d3 commit 99021ba

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Listener/ToolListener.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Claroline\CoreBundle\Manager\ResourceManager;
1818
use Doctrine\ORM\EntityManager;
1919
use Symfony\Bundle\TwigBundle\TwigEngine;
20-
use Symfony\Component\Security\Core\SecurityContextInterface;
20+
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2121
use JMS\DiExtraBundle\Annotation as DI;
2222

2323
/**
@@ -29,7 +29,7 @@ class ToolListener
2929
private $activityRepo;
3030
private $evaluationRepo;
3131
private $resourceManager;
32-
private $securityContext;
32+
private $tokenStorage;
3333
private $templating;
3434
private $utils;
3535

@@ -39,22 +39,22 @@ class ToolListener
3939
* @DI\InjectParams({
4040
* "em" = @DI\Inject("doctrine.orm.entity_manager"),
4141
* "resourceManager" = @DI\Inject("claroline.manager.resource_manager"),
42-
* "securityContext" = @DI\Inject("security.context"),
42+
* "tokenStorage" = @DI\Inject("security.token_storage"),
4343
* "templating" = @DI\Inject("templating"),
4444
* "utils" = @DI\Inject("claroline.security.utilities")
4545
* })
4646
*/
4747
public function __construct(
4848
EntityManager $em,
4949
ResourceManager $resourceManager,
50-
SecurityContextInterface $securityContext,
50+
TokenStorageInterface $tokenStorage,
5151
TwigEngine $templating,
5252
Utilities $utils
5353
)
5454
{
5555
$this->em = $em;
5656
$this->resourceManager = $resourceManager;
57-
$this->securityContext = $securityContext;
57+
$this->tokenStorage = $tokenStorage;
5858
$this->templating = $templating;
5959
$this->utils = $utils;
6060
$this->activityRepo = $em->getRepository('ClarolineCoreBundle:Resource\Activity');
@@ -105,7 +105,7 @@ public function onWorkspaceOpen(DisplayToolEvent $event)
105105

106106
public function fetchActivitiesData($isDesktopTool, Workspace $workspace = null)
107107
{
108-
$token = $this->securityContext->getToken();
108+
$token = $this->tokenStorage->getToken();
109109
$userRoles = $this->utils->getRoles($token);
110110

111111
$criteria = array();

0 commit comments

Comments
 (0)