W3cubDocs

/Symfony 4.1

RoleHierarchy

class RoleHierarchy implements RoleHierarchyInterface

RoleHierarchy defines a role hierarchy.

Properties

protected $map

Methods

__construct(array $hierarchy)
Role[] getReachableRoles(array $roles)

Returns an array of all reachable roles by the given ones.

buildRoleMap()

Details

__construct(array $hierarchy)

Parameters

array $hierarchy An array defining the hierarchy

Role[] getReachableRoles(array $roles)

Returns an array of all reachable roles by the given ones.

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 directly assigned roles

Return Value

Role[] An array of all reachable roles

protected buildRoleMap()

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Security/Core/Role/RoleHierarchy.html