requireRole($this->security, 'ROLE_GESTIONNAIRE'); $document = $this->documents->find($documentId); if (!$document) { $this->mcpError('not_found', "Document not found: {$documentId}"); } $this->em->remove($document); $this->em->flush(); return $this->jsonResponse(['deleted' => true, 'id' => $documentId]); } }