+ "] does not have permission to delete installedPackageIds from resource ID [" + resourceId + "]");
}
// Load entities for references later in the method
Resource resource = entityManager.find(Resource.class, resourceId);
Agent agent = resource.getAgent();
// Persist in separate transaction so it is committed immediately, before the request is sent to the agent
// This will also create the audit trail entry
ContentServiceRequest persistedRequest = contentManager.createRemoveRequest(resourceId, user.getName(),
installedPackageIds, requestNotes);