Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | protected function supports($attribute, $subject) |
||
27 | { |
||
28 | // replace with your own logic |
||
29 | // https://symfony.com/doc/current/security/voters.html |
||
30 | //return ($subject instanceof Part || in_array($subject, ['PERM_parts', 'PERM_parts_name'])); |
||
31 | |||
32 | if ($subject instanceof Part) |
||
33 | { |
||
34 | return in_array($attribute, $this->resolver->listOperationsForPermission('parts'), false); |
||
35 | } |
||
36 | |||
37 | return false; |
||
38 | } |
||
52 |