diff options
author | Kris Wallsmith <kris.wallsmith@gmail.com> | 2012-02-15 14:08:39 -0800 |
---|---|---|
committer | Kris Wallsmith <kris.wallsmith@gmail.com> | 2012-02-15 14:14:40 -0800 |
commit | fb4276a2d2f7b3b19892b4aa9d8c3ca08c9c015e (patch) | |
tree | feed31c46ef48e3ca26dd349a3642110e55b103c | |
parent | 1e7059f6b49abdf26ceeec3e4e2f9ca149fbbc0b (diff) | |
download | symfony-security-fb4276a2d2f7b3b19892b4aa9d8c3ca08c9c015e.zip symfony-security-fb4276a2d2f7b3b19892b4aa9d8c3ca08c9c015e.tar.gz symfony-security-fb4276a2d2f7b3b19892b4aa9d8c3ca08c9c015e.tar.bz2 |
[Security] added AccessMapInterface
-rw-r--r-- | Http/AccessMap.php | 2 | ||||
-rw-r--r-- | Http/AccessMapInterface.php | 33 | ||||
-rw-r--r-- | Http/Firewall/AccessListener.php | 4 | ||||
-rw-r--r-- | Http/Firewall/ChannelListener.php | 4 |
4 files changed, 38 insertions, 5 deletions
diff --git a/Http/AccessMap.php b/Http/AccessMap.php index 6d12b42..de78e15 100644 --- a/Http/AccessMap.php +++ b/Http/AccessMap.php @@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request; * * @author Fabien Potencier <fabien@symfony.com> */ -class AccessMap +class AccessMap implements AccessMapInterface { private $map = array(); diff --git a/Http/AccessMapInterface.php b/Http/AccessMapInterface.php new file mode 100644 index 0000000..dbd7282 --- /dev/null +++ b/Http/AccessMapInterface.php @@ -0,0 +1,33 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Security\Http; + +use Symfony\Component\HttpFoundation\Request; + +/** + * AccessMap allows configuration of different access control rules for + * specific parts of the website. + * + * @author Fabien Potencier <fabien@symfony.com> + * @author Kris Wallsmith <kris@symfony.com> + */ +interface AccessMapInterface +{ + /** + * Returns security attributes and required channel for the supplied request. + * + * @param Request $request The current request + * + * @return array A tuple of security attributes and the required channel + */ + function getPatterns(Request $request); +} diff --git a/Http/Firewall/AccessListener.php b/Http/Firewall/AccessListener.php index 877b6c3..3e2d3a5 100644 --- a/Http/Firewall/AccessListener.php +++ b/Http/Firewall/AccessListener.php @@ -13,7 +13,7 @@ namespace Symfony\Component\Security\Http\Firewall; use Symfony\Component\Security\Core\SecurityContextInterface; use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; -use Symfony\Component\Security\Http\AccessMap; +use Symfony\Component\Security\Http\AccessMapInterface; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; @@ -33,7 +33,7 @@ class AccessListener implements ListenerInterface private $authManager; private $logger; - public function __construct(SecurityContextInterface $context, AccessDecisionManagerInterface $accessDecisionManager, AccessMap $map, AuthenticationManagerInterface $authManager, LoggerInterface $logger = null) + public function __construct(SecurityContextInterface $context, AccessDecisionManagerInterface $accessDecisionManager, AccessMapInterface $map, AuthenticationManagerInterface $authManager, LoggerInterface $logger = null) { $this->context = $context; $this->accessDecisionManager = $accessDecisionManager; diff --git a/Http/Firewall/ChannelListener.php b/Http/Firewall/ChannelListener.php index 847753f..9b0f8c6 100644 --- a/Http/Firewall/ChannelListener.php +++ b/Http/Firewall/ChannelListener.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Security\Http\Firewall; -use Symfony\Component\Security\Http\AccessMap; +use Symfony\Component\Security\Http\AccessMapInterface; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; @@ -28,7 +28,7 @@ class ChannelListener implements ListenerInterface private $authenticationEntryPoint; private $logger; - public function __construct(AccessMap $map, AuthenticationEntryPointInterface $authenticationEntryPoint, LoggerInterface $logger = null) + public function __construct(AccessMapInterface $map, AuthenticationEntryPointInterface $authenticationEntryPoint, LoggerInterface $logger = null) { $this->map = $map; $this->authenticationEntryPoint = $authenticationEntryPoint; |