}
                 $update = TRUE;
                 $msg = 'status_metadata_parsed_ok';
             } else {
                 $msg = 'error_metadata_wrong_entity';
             }
         } else {
             $msg = 'error_not_valid_json';
         }
     } catch (Exception $e) {
         $msg = 'error_metadata_not_parsed';
     }
 }
 // Disable consent
 if (isset($_POST['add-consent']) && $guard->hasPermission('disableconsent', $entity->getWorkflow(), $user->getType())) {
     $mcontroller->clearConsent();
     foreach ($_POST['add-consent'] as $key) {
         if ($mcontroller->addDisableConsent($key)) {
             $update = TRUE;
             $note .= 'Consent disabled for: ' . $key . '<br />';
         }
     }
 }
 // Remote entities
 if ($guard->hasPermission('blockremoteentity', $entity->getWorkflow(), $user->getType())) {
     if (isset($_POST['addBlocked'])) {
         $mcontroller->setAllowedAll('no');
         $current = array_keys($mcontroller->getBlockedEntities());
         // Add the ones that are selected
         foreach ($_POST['addBlocked'] as $key) {
             if ($mcontroller->addBlockedEntity($key)) {