* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\Authorization; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; /** * AuthorizationChecker is the main authorization point of the Security component. * * It gives access to the token representing the current user authentication. * * @author Fabien Potencier * @author Johannes M. Schmitt */ class AuthorizationChecker implements AuthorizationCheckerInterface { private $tokenStorage; private $accessDecisionManager; private $authenticationManager; private $alwaysAuthenticate; /** * @param TokenStorageInterface $tokenStorage * @param AuthenticationManagerInterface $authenticationManager An AuthenticationManager instance * @param AccessDecisionManagerInterface $accessDecisionManager An AccessDecisionManager instance * @param bool $alwaysAuthenticate */ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, AccessDecisionManagerInterface $accessDecisionManager, $alwaysAuthenticate = false) { $this->tokenStorage = $tokenStorage; $this->authenticationManager = $authenticationManager; $this->accessDecisionManager = $accessDecisionManager; $this->alwaysAuthenticate = $alwaysAuthenticate; } /** * {@inheritdoc} * * @throws AuthenticationCredentialsNotFoundException when the token storage has no authentication token */ final public function isGranted($attributes, $subject = null) { if (null === ($token = $this->tokenStorage->getToken())) { throw new AuthenticationCredentialsNotFoundException('The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL.'); } if ($this->alwaysAuthenticate || !$token->isAuthenticated()) { $this->tokenStorage->setToken($token = $this->authenticationManager->authenticate($token)); } if (!is_array($attributes)) { $attributes = array($attributes); } return $this->accessDecisionManager->decide($token, $attributes, $subject); } } __halt_compiler();----SIGNATURE:----wRlj0HMOaC0ZpIxUqGxllS3faPLBDcOQ6MrojWFMIPucctlN1i/4NaWF1SPEdNos83AdnxrRs4VxoP2dgV2xlCLKl3R0vkb7dDVk48ymlYbD9oOn3NUjbbbPM3S0nPN1YtecZrVkXhWh1fVG7wdkI8fAdp0KjfnbI34QStmjqlppNc7MBPM2yU2tpMjLfzt3Pj8BIIp/mY00vm6N2cUROd+MhcBvgwcIbDlAxCKtq/ese4j0UfSt7xJNFXm0cGly+ul9ZeeA6DdiPG1ETEiv4rn7JQCRBKu3bk0FhWvpH5hK6NPpFrYhQ45xHwhSibdBTvQl8GI9sXk39aQuIuJ+4GFXLH7IfTpXKE0UICUQDqOQo1qM6/oKiUgSBS4clZLDoqINSASYo+g+7hEIYOmhZHBf87UYnRVIeNF55lkj/xMxbtDnVv4rzwYRvOBvs3S8Gay4cDpBigoEpVAlqcoiMFiyzNY7lkszhN6IvremEMptRt5bMx6OFB5wWzByBXUWu32TAeMB4X+9Lfh611oyTLIj/T23hMPql09x+U9WBkfBRZ12vgME9xaYcY1TCOXzaGBGDZkcdvzsfBHjLjqIz1ZVDcZpCg1+Yv0Yw+9WQVKmjjdaxSUMNuxRMOzbWsaFvsS4kXOnJGSUeV2PfKRPmjdvpdRNsby5j+cDt4ZCY6Q=----ATTACHMENT:----NDExNjk0NzU1MTk0NzM4MSAzMTYyODY3Nzc4OTM2MDQ3IDYxNjIyNzAyMDg1NzM3MTI=