1717use Claroline \CoreBundle \Manager \ResourceManager ;
1818use Doctrine \ORM \EntityManager ;
1919use Symfony \Bundle \TwigBundle \TwigEngine ;
20- use Symfony \Component \Security \Core \SecurityContextInterface ;
20+ use Symfony \Component \Security \Core \Authentication \ Token \ Storage \ TokenStorageInterface ;
2121use 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