public function copy(ResourceNode $original, ResourceNode $node)
    {
        $originalRights = $this->rightsRepo->findBy(array('resourceNode' => $original));
        $this->om->startFlushSuite();

        foreach ($originalRights as $originalRight) {
            $new = $this->om->factory('Claroline\CoreBundle\Entity\Resource\ResourceRights');
            $new->setRole($originalRight->getRole());
            $new->setResourceNode($node);
            $new->setMask($originalRight->getMask());
            $new->setCreatableResourceTypes($originalRight->getCreatableResourceTypes()->toArray());
            $this->om->persist($new);
            $node->addRight($new);
        }

        $this->om->endFlushSuite();

        return $node;
    }