Skip to content

Commit

Permalink
More clearer DefaultSiteAccessVoter
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Aug 12, 2016
1 parent 5f09cea commit 0723ae0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Matcher/Voter/DefaultSiteAccessVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0723ae0

Please sign in to comment.