From 0723ae0d6f796912f8563d20a7908a135aaf34f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edi=20Modri=C4=87?= Date: Fri, 12 Aug 2016 10:12:12 +0200 Subject: [PATCH] More clearer DefaultSiteAccessVoter --- Matcher/Voter/DefaultSiteAccessVoter.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Matcher/Voter/DefaultSiteAccessVoter.php b/Matcher/Voter/DefaultSiteAccessVoter.php index c3887da..8d5c8d8 100644 --- a/Matcher/Voter/DefaultSiteAccessVoter.php +++ b/Matcher/Voter/DefaultSiteAccessVoter.php @@ -31,8 +31,11 @@ public function __construct($defaultSiteAccess) */ public function vote($siteAccess, array $routeConfig) { - // Siteaccess is allowed if it is a default one and default is allowed - if ($siteAccess === $this->defaultSiteAccess && in_array(self::DEFAULT_KEY, $routeConfig)) { + if ($siteAccess !== $this->defaultSiteAccess) { + return VoterInterface::ABSTAIN; + } + + if (in_array(static::DEFAULT_KEY, $routeConfig)) { return true; }