Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function vote(string $siteAccess, array $routeConfig): ?bool |
||
25 | { |
||
26 | // We skip the check if siteaccess is not part of any group |
||
27 | if (!isset($this->groupsBySiteAccess[$siteAccess])) { |
||
28 | return VoterInterface::ABSTAIN; |
||
29 | } |
||
30 | |||
31 | // We allow the siteaccess if any group to which the siteaccess belongs |
||
32 | // is in the list of allowed siteaccesses |
||
33 | foreach ($this->groupsBySiteAccess[$siteAccess] as $group) { |
||
34 | if (in_array($group, $routeConfig, true)) { |
||
35 | return true; |
||
36 | } |
||
37 | } |
||
38 | |||
39 | return VoterInterface::ABSTAIN; |
||
40 | } |
||
41 | } |
||
42 |