Conditions | 1 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function updateTokenRoles(JWTCreatedEvent $event): void |
||
26 | { |
||
27 | $user = $event->getUser(); |
||
28 | $data = $event->getData(); |
||
29 | $reachableRoles = $this->roleHierarchy->getReachableRoles($user->getRoles()); |
||
30 | $data['roles'] = array_map(function(Role $role) { return (string) $role->getRole(); }, $reachableRoles); |
||
31 | $event->setData($data); |
||
32 | } |
||
34 |