Файловый менеджер - Редактировать - /home/avadvi5/calendar.aeronextgen.com/davis/vendor/symfony/security-core/Authorization/Strategy/UnanimousStrategy.php
Ðазад
<?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\Core\Authorization\Strategy; use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; /** * Grants access if only grant (or abstain) votes were received. * * If all voters abstained from voting, the decision will be based on the * allowIfAllAbstainDecisions property value (defaults to false). * * @author Fabien Potencier <fabien@symfony.com> * @author Alexander M. Turek <me@derrabus.de> */ final class UnanimousStrategy implements AccessDecisionStrategyInterface, \Stringable { public function __construct( private bool $allowIfAllAbstainDecisions = false, ) { } public function decide(\Traversable $results): bool { $grant = 0; foreach ($results as $result) { if (VoterInterface::ACCESS_DENIED === $result) { return false; } if (VoterInterface::ACCESS_GRANTED === $result) { ++$grant; } } // no deny votes if ($grant > 0) { return true; } return $this->allowIfAllAbstainDecisions; } public function __toString(): string { return 'unanimous'; } }
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка