class RoleHierarchyVoter extends RoleVoter
RoleHierarchyVoter uses a RoleHierarchy to determine the roles granted to the user before voting.
Methods
__construct(RoleHierarchyInterface $roleHierarchy, string $prefix = 'ROLE_') Constructor. | ||
Boolean | supportsAttribute(string $attribute) Checks if the voter supports the given attribute. | from RoleVoter |
Boolean | supportsClass(string $class) Checks if the voter supports the given class. | from RoleVoter |
integer | vote(TokenInterface $token, object $object, array $attributes) Returns the vote for the given parameters. | from RoleVoter |
Details
__construct(RoleHierarchyInterface $roleHierarchy, string $prefix = 'ROLE_')
Constructor.
Boolean supportsAttribute(string $attribute)
Checks if the voter supports the given attribute.
Boolean supportsClass(string $class)
Checks if the voter supports the given class.
integer vote(TokenInterface $token, object $object, array $attributes)
Returns the vote for the given parameters.
This method must return one of the following constants: ACCESSGRANTED, ACCESSDENIED, or ACCESS_ABSTAIN.
Please login to continue.