ExpressionVoter
class ExpressionVoter implements VoterInterface
ExpressionVoter голосует на основе оценки выражения.
Методы
| __construct(ExpressionLanguage $expressionLanguage, AuthenticationTrustResolverInterface $trustResolver, RoleHierarchyInterface $roleHierarchy = null) | ||
| addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) устарело | ||
| int | vote(TokenInterface $token, mixed $subject, array $attributes) Возвращает голос для заданных параметров. |
Подробности
__construct(ExpressionLanguage $expressionLanguage, AuthenticationTrustResolverInterface $trustResolver, RoleHierarchyInterface $roleHierarchy = null)
Параметры
| ExpressionLanguage | $expressionLanguage | |
| AuthenticationTrustResolverInterface | $trustResolver | |
| RoleHierarchyInterface | $roleHierarchy |
addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) устарело
устарело
Параметры
| ExpressionFunctionProviderInterface | $provider |
int vote(TokenInterface $token, mixed $subject, array $attributes)
Возвращает голос для заданных параметров.
Этот метод должен вернуть одну из следующих констант: ACCESS_GRANTED, ACCESS_DENIED или ACCESS_ABSTAIN.
Параметры
| TokenInterface | $token | Экземпляр TokenInterface |
| mixed | $subject | Защищаемый объект |
| array | $attributes | Массив атрибутов, связанных с вызываемым методом |
Значение результата
| int | либо ACCESS_GRANTED, ACCESS_ABSTAIN, или ACCESS_DENIED |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.html