Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 public function openResourceForPortal(ResourceNode $node)
 {
     $this->rightsManager->editPerms(1, $this->roleManager->getRoleByName('ROLE_USER'), $node, false, [], true);
     $this->rightsManager->editPerms(1, $this->roleManager->getRoleByName('ROLE_ANONYMOUS'), $node, false, [], true);
 }