RoleHierarchyVoter
extends RoleVoter
in package
RoleHierarchyVoter uses a RoleHierarchy to determine the roles granted to the user before voting.
Tags
Table of Contents
- $prefix : mixed
- $roleHierarchy : mixed
- __construct() : mixed
- vote() : int
- Returns the vote for the given parameters.
- extractRoles() : mixed
Properties
$prefix
private
mixed
$prefix
$roleHierarchy
private
mixed
$roleHierarchy
Methods
__construct()
public
__construct(RoleHierarchyInterface $roleHierarchy[, string $prefix = 'ROLE_' ]) : mixed
Parameters
- $roleHierarchy : RoleHierarchyInterface
- $prefix : string = 'ROLE_'
Return values
mixed —vote()
Returns the vote for the given parameters.
public
vote(TokenInterface $token, mixed $subject, array<string|int, mixed> $attributes) : int
Parameters
- $token : TokenInterface
- $subject : mixed
-
The subject to secure
- $attributes : array<string|int, mixed>
-
An array of attributes associated with the method being invoked
Return values
int —either ACCESS_GRANTED, ACCESS_ABSTAIN, or ACCESS_DENIED
extractRoles()
protected
extractRoles(TokenInterface $token) : mixed
Parameters
- $token : TokenInterface