Interface

Symfony\Component\Security\Core\SecurityContextInterface

interface SecurityContextInterface

The SecurityContextInterface.

Constants

ACCESS_DENIED_ERROR

AUTHENTICATION_ERROR

LAST_USERNAME

Methods

TokenInterface|null getToken()

Returns the current security token.

void setToken(TokenInterface $token = null)

Sets the authentication token.

Boolean isGranted(array $attributes, mixed $object = null)

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

Details

at line 32
public TokenInterface|null getToken()

Returns the current security token.

Return Value

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

at line 41
public void setToken(TokenInterface $token = null)

Sets the authentication token.

Parameters

TokenInterface $token

Return Value

void

at line 51
public Boolean isGranted(array $attributes, mixed $object = null)

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

Parameters

array $attributes
mixed $object

Return Value

Boolean