SwitchUserListener

class SwitchUserListener implements ListenerInterface

SwitchUserListener allows a user to impersonate another one temporarily (like the Unix su command).

Methods

__construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, UserCheckerInterface $userChecker, $providerKey, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, $usernameParameter = '_switch_user', $role = 'ROLE_ALLOWED_TO_SWITCH', EventDispatcherInterface $dispatcher = null)
handle(GetResponseEvent $event)

Handles the switch to another user.

Details

__construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, UserCheckerInterface $userChecker, $providerKey, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, $usernameParameter = '_switch_user', $role = 'ROLE_ALLOWED_TO_SWITCH', EventDispatcherInterface $dispatcher = null)

Parameters

TokenStorageInterface $tokenStorage
UserProviderInterface $provider
UserCheckerInterface $userChecker
$providerKey
AccessDecisionManagerInterface $accessDecisionManager
LoggerInterface $logger
$usernameParameter
$role
EventDispatcherInterface $dispatcher

handle(GetResponseEvent $event)

Handles the switch to another user.

Parameters

GetResponseEvent $event

Exceptions

LogicException if switching to a user failed
doc_Symfony
2016-10-28 06:33:50
Comments
Leave a Comment

Please login to continue.