protected function isOrganizationManager(TokenInterface $token, $object)
    {
        $adminOrganizations = $token->getUser()->getAdministratedOrganizations();
        $objectOrganizations = $object->getOrganizations();

        foreach ($adminOrganizations as $adminOrganization) {
            foreach ($objectOrganizations as $objectOrganization) {
                if ($objectOrganization === $adminOrganization) {
                    return true;
                }
            }
        }

        return false;
    }
protected function isOrganizationManager(TokenInterface $token, $object)
    {
        $adminOrganizations = $token->getUser()->getAdministratedOrganizations();
        $objectOrganizations = $object->getOrganizations();

        foreach ($adminOrganizations as $adminOrganization) {
            foreach ($objectOrganizations as $objectOrganization) {
                if ($objectOrganization === $adminOrganization) {
                    return true;
                }
            }
        }

        return false;
    }
protected function isOrganizationManager ( TokenInterface $ token , $ object ) { $ adminOrganizations = $ token -> getUser ( ) -> getAdministratedOrganizations ( ) ; $ objectOrganizations = $ object -> getOrganizations ( ) ; foreach ( $ adminOrganizations as $ adminOrganization ) { foreach ( $ objectOrganizations as $ objectOrganization ) { if ( $ objectOrganization === $ adminOrganization ) { return true ; } } } return false ; }
Copied from the AbstractVoter.

@param TokenInterface $token
@param User|Group     $object

@return bool
Copied from the AbstractVoter .