SecurityDataCollector

class SecurityDataCollector extends DataCollector

Methods

serialize() from DataCollector
unserialize($data) from DataCollector
__construct(TokenStorageInterface $tokenStorage = null, RoleHierarchyInterface $roleHierarchy = null)
collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Request and Response.

bool isEnabled()

Checks if security is enabled.

string getUser()

Gets the user.

array getRoles()

Gets the roles of the user.

array getInheritedRoles()

Gets the inherited roles of the user.

bool supportsRoleHierarchy()

Checks if the data contains information about inherited roles. Still the inherited roles can be an empty array.

bool isAuthenticated()

Checks if the user is authenticated or not.

string getTokenClass()

Get the class name of the security token.

string getName()

Returns the name of the collector.

Details

serialize()

unserialize($data)

Parameters

$data

__construct(TokenStorageInterface $tokenStorage = null, RoleHierarchyInterface $roleHierarchy = null)

Parameters

TokenStorageInterface $tokenStorage
RoleHierarchyInterface $roleHierarchy

collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Request and Response.

Parameters

Request $request
Response $response
Exception $exception

bool isEnabled()

Checks if security is enabled.

Return Value

bool true if security is enabled, false otherwise

string getUser()

Gets the user.

Return Value

string The user

array getRoles()

Gets the roles of the user.

Return Value

array The roles

array getInheritedRoles()

Gets the inherited roles of the user.

Return Value

array The inherited roles

bool supportsRoleHierarchy()

Checks if the data contains information about inherited roles. Still the inherited roles can be an empty array.

Return Value

bool true if the profile was contains inherited role information

bool isAuthenticated()

Checks if the user is authenticated or not.

Return Value

bool true if the user is authenticated, false otherwise

string getTokenClass()

Get the class name of the security token.

Return Value

string The token

string getName()

Returns the name of the collector.

Return Value

string The collector name

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.html