PHP Class Symfony\Component\Security\Core\SecurityContext

It gives access to the token representing the current user authentication.
Deprecation: since version 2.6, to be removed in 3.0.
Author: Fabien Potencier ([email protected])
Author: Johannes M. Schmitt ([email protected])
Inheritance: implements Symfony\Component\Security\Core\SecurityContextInterface
显示文件 Open project: ctrlaltdylan/MirrorMirror Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface | Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface $tokenStorage, Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface | Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface $authorizationChecker, boolean $alwaysAuthenticate = false ) For backwards compatibility, the signature of sf <2.6 still works.
getToken ( )
isGranted ( $attributes, $object = null )
setToken ( Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token = null )

Method Details

__construct() public method

For backwards compatibility, the signature of sf <2.6 still works.
public __construct ( Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface | Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface $tokenStorage, Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface | Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface $authorizationChecker, boolean $alwaysAuthenticate = false )
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface | Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface
$authorizationChecker Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface | Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface
$alwaysAuthenticate boolean only applicable with old signature

getToken() public method

Deprecation: since version 2.6, to be removed in 3.0. Use TokenStorageInterface::getToken() instead. {@inheritdoc}
public getToken ( )

isGranted() public method

Deprecation: since version 2.6, to be removed in 3.0. Use AuthorizationCheckerInterface::isGranted() instead. {@inheritdoc}
public isGranted ( $attributes, $object = null )

setToken() public method

Deprecation: since version 2.6, to be removed in 3.0. Use TokenStorageInterface::setToken() instead. {@inheritdoc}
public setToken ( Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token = null )
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface