diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2014-12-12 07:54:58 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2014-12-12 07:54:58 +0100 |
commit | fa7f23f270c874a5b53e9b96ac46274c73986322 (patch) | |
tree | 01f14f2c85d6684288ee8e77b78f2661179d6f1f | |
parent | 087a6be7f5a4109a2869b8ff6512f4e42c8e8026 (diff) | |
parent | 6ef63a7515134ae5d450490cceeee4af6f71f197 (diff) | |
download | symfony-security-fa7f23f270c874a5b53e9b96ac46274c73986322.zip symfony-security-fa7f23f270c874a5b53e9b96ac46274c73986322.tar.gz symfony-security-fa7f23f270c874a5b53e9b96ac46274c73986322.tar.bz2 |
bug #12935 [2.6] [Security] Fixed ExpressionVoter - addExpressionLanguageProvider (Luca Genuzio)
This PR was merged into the 2.6 branch.
Discussion
----------
[2.6] [Security] Fixed ExpressionVoter - addExpressionLanguageProvider
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | ---
| Fixed tickets | ---
| License | MIT
| Doc PR | ---
Fix missing addExpressionLanguageProvider in [ExpressionVoter](https://github.com/symfony/symfony/blob/2.6/src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php), used by [AddExpressionLanguageProvidersPass](https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php) to add expression providers.
Commits
-------
6c70bc5 Fix missing addExpressionLanguageProvider (used by service container to add expression providers)
-rw-r--r-- | Core/Authorization/Voter/ExpressionVoter.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Core/Authorization/Voter/ExpressionVoter.php b/Core/Authorization/Voter/ExpressionVoter.php index 3263803..98b8f50 100644 --- a/Core/Authorization/Voter/ExpressionVoter.php +++ b/Core/Authorization/Voter/ExpressionVoter.php @@ -15,6 +15,7 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface; use Symfony\Component\Security\Core\Authorization\ExpressionLanguage; use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; +use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; use Symfony\Component\ExpressionLanguage\Expression; use Symfony\Component\HttpFoundation\Request; @@ -43,6 +44,11 @@ class ExpressionVoter implements VoterInterface $this->roleHierarchy = $roleHierarchy; } + public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) + { + $this->expressionLanguage->registerProvider($provider); + } + /** * {@inheritdoc} */ |