summaryrefslogtreecommitdiffstats
path: root/Core
diff options
context:
space:
mode:
authorDennis Benkert <spinecrasher@googlemail.com>2013-08-09 15:30:49 +0000
committerDennis Benkert <spinecrasher@googlemail.com>2013-08-12 21:21:22 +0200
commita1f26cf5894ebd567720a41610440759c533cb55 (patch)
treee796c780d79d5c7a0e00764601cd14d94a63335c /Core
parenta19068947dca7cb60616b838a0d451ca61e40fe5 (diff)
downloadsymfony-security-a1f26cf5894ebd567720a41610440759c533cb55.zip
symfony-security-a1f26cf5894ebd567720a41610440759c533cb55.tar.gz
symfony-security-a1f26cf5894ebd567720a41610440759c533cb55.tar.bz2
[Security] Added a check for strategies in AccessDecisionManager
Diffstat (limited to 'Core')
-rw-r--r--Core/Authorization/AccessDecisionManager.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/Core/Authorization/AccessDecisionManager.php b/Core/Authorization/AccessDecisionManager.php
index 6028c42..18c3569 100644
--- a/Core/Authorization/AccessDecisionManager.php
+++ b/Core/Authorization/AccessDecisionManager.php
@@ -43,8 +43,13 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
throw new \InvalidArgumentException('You must at least add one voter.');
}
+ $strategyMethod = 'decide'.ucfirst($strategy);
+ if (!is_callable(array($this, $strategyMethod))) {
+ throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
+ }
+
$this->voters = $voters;
- $this->strategy = 'decide'.ucfirst($strategy);
+ $this->strategy = $strategyMethod;
$this->allowIfAllAbstainDecisions = (Boolean) $allowIfAllAbstainDecisions;
$this->allowIfEqualGrantedDeniedDecisions = (Boolean) $allowIfEqualGrantedDeniedDecisions;
}