/** * Check that all Activities and Resources as at least same rights than the Path * @return \Innova\PathBundle\Manager\PublishingManager */ protected function manageRights() { // Grab Resources and Activities $nodes = $this->retrieveAllNodes($this->path->getSteps()->toArray()); if (!empty($nodes)) { $pathRights = $this->path->getResourceNode()->getRights(); foreach ($nodes as $node) { foreach ($pathRights as $right) { if ($right->getMask() & 1) { $this->rightsManager->editPerms($right->getMask(), $right->getRole(), $node, true); } } } } return $this; }
/** * Delete path. * * @param \Innova\PathBundle\Entity\Path\Path $path * * @return bool * * @throws \Exception */ public function delete(Path $path) { // User can delete current path $this->om->remove($path->getResourceNode()); $this->om->flush(); return $this; }