class SecurityContext implements SecurityContextInterface

deprecated since version 2.6, to be removed in 3.0.

SecurityContext is the main entry point of the Security component.

It gives access to the token representing the current user authentication.

Methods

__construct(TokenStorageInterface|AuthenticationManagerInterface $tokenStorage, AuthorizationCheckerInterface|AccessDecisionManagerInterface $authorizationChecker, bool $alwaysAuthenticate = false)

For backwards compatibility, the signature of sf <2.6 still works.

getToken() deprecated

No description

setToken(TokenInterface $token = null) deprecated

No description

bool
isGranted(mixed $attributes, mixed $object = null) deprecated

No description

Details

at line 53
__construct(TokenStorageInterface|AuthenticationManagerInterface $tokenStorage, AuthorizationCheckerInterface|AccessDecisionManagerInterface $authorizationChecker, bool $alwaysAuthenticate = false)

For backwards compatibility, the signature of sf <2.6 still works.

Parameters

TokenStorageInterface|AuthenticationManagerInterface $tokenStorage
AuthorizationCheckerInterface|AccessDecisionManagerInterface $authorizationChecker
bool $alwaysAuthenticate Only applicable with old signature

at line 80
TokenInterface|null getToken() deprecated

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

Return Value

TokenInterface|null A TokenInterface instance or null if no authentication information is available

at line 90
setToken(TokenInterface $token = null) deprecated

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

Parameters

TokenInterface $token A TokenInterface token, or null if no further authentication information should be stored

at line 100
bool isGranted(mixed $attributes, mixed $object = null) deprecated

deprecated since version 2.6, to be removed in 3.0. Use AuthorizationCheckerInterface::isGranted() instead. {@inheritdoc}

Parameters

mixed $attributes
mixed $object

Return Value

bool