Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | protected function voteOnAttribute($attribute, $subject, TokenInterface $token) |
||
35 | { |
||
36 | // our previous business logic indicates that mods and admins can do it regardless |
||
37 | foreach ($token->getRoles() as $role) { |
||
38 | if (\in_array($role->getRole(), ['ROLE_MODERATOR', 'ROLE_ADMIN'])) { |
||
39 | return true; |
||
40 | } |
||
41 | } |
||
42 | |||
43 | return false; |
||
44 | } |
||
46 |