RoleHierarchyVoter
extends RoleVoter
in package
RoleHierarchyVoter uses a RoleHierarchy to determine the roles granted to the user before voting.
Tags
Table of Contents
Properties
- $prefix : string
- $roleHierarchy : mixed
Methods
- __construct() : mixed
- supportsAttribute() : bool
- supportsType() : bool
- vote() : int
- {@inheritdoc}
- extractRoles() : mixed
Properties
$prefix
private
string
$prefix
$roleHierarchy
private
mixed
$roleHierarchy
Methods
__construct()
public
__construct(RoleHierarchyInterface $roleHierarchy[, string $prefix = 'ROLE_' ]) : mixed
Parameters
- $roleHierarchy : RoleHierarchyInterface
- $prefix : string = 'ROLE_'
supportsAttribute()
public
supportsAttribute(string $attribute) : bool
Parameters
- $attribute : string
Return values
boolsupportsType()
public
supportsType(string $subjectType) : bool
Parameters
- $subjectType : string
-
The type of the subject inferred by
get_class
orget_debug_type
Return values
boolvote()
{@inheritdoc}
public
vote(TokenInterface $token, mixed $subject, array<string|int, mixed> $attributes) : int
Parameters
- $token : TokenInterface
- $subject : mixed
- $attributes : array<string|int, mixed>
Return values
intextractRoles()
protected
extractRoles(TokenInterface $token) : mixed
Parameters
- $token : TokenInterface