Symfony2 API
Class

Symfony\Component\Security\Core\Role\RoleHierarchy

class RoleHierarchy implements RoleHierarchyInterface

RoleHierarchy defines a role hierarchy.

Methods

__construct(array $hierarchy)

Constructor.

RoleInterface[] getReachableRoles(array $roles)

Returns an array of all reachable roles.

Details

at line 29
public __construct(array $hierarchy)

Constructor.

Parameters

array $hierarchy An array defining the hierarchy

at line 43
public RoleInterface[] getReachableRoles(array $roles)

Returns an array of all reachable roles.

Reachable roles are the roles directly assigned but also all roles that
are transitively reachable from them in the role hierarchy.

Parameters

array $roles An array of RoleInterface instances

Return Value

RoleInterface[] An array of RoleInterface instances