HandleCommandVoter
extends Voter
in package
Voter for security checks on handling commands.
Tags
Table of Contents
- $commandRoleMapping : array<string|int, mixed>
- Command - Require role mapping
- $decisionManager : AccessDecisionManagerInterface
- The decision manager.
- __construct() : mixed
- Create a new HandleCommandVoter.
- supports() : bool
- The voter supports checking handle commands
- voteOnAttribute() : bool
- Checks if the currently logged on user may handle $subject.
- getAllowedRoles() : array<string|int, mixed>
- Gets the roles allowed to handle a command of $type
Properties
$commandRoleMapping
Command - Require role mapping
private
array<string|int, mixed>
$commandRoleMapping
= []
$decisionManager
The decision manager.
private
AccessDecisionManagerInterface
$decisionManager
Methods
__construct()
Create a new HandleCommandVoter.
public
__construct(AccessDecisionManagerInterface $decisionManager[, array<string|int, mixed> $commandRoleMapping = [] ]) : mixed
Parameters
- $decisionManager : AccessDecisionManagerInterface
- $commandRoleMapping : array<string|int, mixed> = []
Return values
mixed —supports()
The voter supports checking handle commands
protected
supports(string $attribute, object $subject) : bool
Parameters
- $attribute : string
- $subject : object
Return values
bool —voteOnAttribute()
Checks if the currently logged on user may handle $subject.
protected
voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token) : bool
Parameters
- $attribute : string
- $subject : mixed
- $token : TokenInterface
Return values
bool —getAllowedRoles()
Gets the roles allowed to handle a command of $type
private
getAllowedRoles(string $type) : array<string|int, mixed>
Parameters
- $type : string