$note .= 'Remote entity added: ' . $key . '<br />';
             }
         }
         // Remove the ones that were, but are now no longer selected
         foreach ($current as $entityid) {
             if (!in_array($entityid, $_POST['addBlocked'])) {
                 if ($mcontroller->removeBlockedEntity($entityid)) {
                     $update = TRUE;
                     $note .= 'Existing entity removed: ' . $entityid . '<br/>';
                 }
             }
         }
     } else {
         if (count($mcontroller->getBlockedEntities())) {
             // There were blocked entities but they were no longer posted; we should clear them all
             $mcontroller->clearBlockedEntities();
             $update = TRUE;
         }
     }
 }
 if ($guard->hasPermission('blockremoteentity', $entity->getWorkflow(), $user->getType())) {
     if (isset($_POST['addAllowed'])) {
         $mcontroller->setAllowedAll('no');
         $current = array_keys($mcontroller->getAllowedEntities());
         // Add the ones that are selected
         foreach ($_POST['addAllowed'] as $key) {
             if ($mcontroller->addAllowedEntity($key)) {
                 $update = TRUE;
                 $note .= 'Remote entity added: ' . $key . '<br />';
             }
         }