Identity/SecurityIdentityManager.php
protected function addReachableRoles(TokenInterface $token, array $sids)
    {
        foreach ($this->roleHierarchy->getReachableRoles($token->getRoles()) as $role) {
            $sids[] = RoleSecurityIdentity::fromAccount(RoleUtil::formatName($role));
        }

        return $sids;
    }
protected function addReachableRoles(TokenInterface $token, array $sids)
    {
        foreach ($this->roleHierarchy->getReachableRoles($token->getRoles()) as $role) {
            $sids[] = RoleSecurityIdentity::fromAccount(RoleUtil::formatName($role));
        }

        return $sids;
    }
protected function addReachableRoles ( TokenInterface $ token , array $ sids ) { foreach ( $ this -> roleHierarchy -> getReachableRoles ( $ token -> getRoles ( ) ) as $ role ) { $ sids [ ] = RoleSecurityIdentity :: fromAccount ( RoleUtil :: formatName ( $ role ) ) ; } return $ sids ; }
Add the security identities of reachable roles.

@param TokenInterface              $token The token
@param SecurityIdentityInterface[] $sids  The security identities

@return SecurityIdentityInterface[]
Add the security identities of reachable roles .