interface SecurityContextInterface implements TokenStorageInterface, AuthorizationCheckerInterface

deprecated since version 2.6, to be removed in 3.0.

The SecurityContextInterface.

Constants

ACCESS_DENIED_ERROR

AUTHENTICATION_ERROR

LAST_USERNAME

Methods

getToken()

Returns the current security token.

setToken(TokenInterface $token = null)

Sets the authentication token.

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

Checks if the attributes are granted against the current authentication token and optionally supplied object.

Details

in TokenStorageInterface at line line 28
TokenInterface|null getToken()

Returns the current security token.

Return Value

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

in TokenStorageInterface at line line 35
setToken(TokenInterface $token = null)

Sets the authentication token.

Parameters

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

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

Checks if the attributes are granted against the current authentication token and optionally supplied object.

Parameters

mixed $attributes
mixed $object

Return Value

bool