예제 #1
0
 /**
  * @param string $permission
  * @param Wiki   $wiki
  *
  * @return bool
  */
 public function isUserGranted($permission, Wiki $wiki, $collection = null)
 {
     if ($collection === null) {
         $collection = new ResourceCollection([$wiki->getResourceNode()]);
     }
     $checkPermission = false;
     if ($this->get('security.authorization_checker')->isGranted($permission, $collection)) {
         $checkPermission = true;
     }
     return $checkPermission;
 }
 /**
  * @param Wiki    $wiki
  * @param Section $section
  */
 public function __construct(Wiki $wiki, Section $section)
 {
     $details = array('section' => array('wiki' => $wiki->getId(), 'id' => $section->getId(), 'title' => $section->getActiveContribution()->getTitle(), 'text' => $section->getActiveContribution()->getText(), 'author' => $section->getAuthor()->getFirstName() . ' ' . $section->getAuthor()->getLastName()));
     parent::__construct($wiki->getResourceNode(), $details);
 }
 /**
  * @param Wiki    $wiki
  * @param Section $section
  * @param array   $changeSet
  */
 public function __construct(Wiki $wiki, Section $section, $changeSet)
 {
     $details = array('section' => array('wiki' => $wiki->getId(), 'id' => $section->getId(), 'title' => $section->getActiveContribution()->getTitle(), 'text' => $section->getActiveContribution()->getText(), 'visible' => $section->getVisible(), 'changeSet' => $changeSet));
     parent::__construct($wiki->getResourceNode(), $details);
 }
 /**
  * @param Wiki    $wiki
  * @param Section $section
  */
 public function __construct(Wiki $wiki, Section $section)
 {
     $this->wiki = $wiki;
     $this->details = array('section' => array('wiki' => $wiki->getId(), 'id' => $section->getId(), 'title' => $section->getActiveContribution()->getTitle(), 'text' => $section->getActiveContribution()->getText(), 'visible' => $section->getVisible()));
     parent::__construct($wiki->getResourceNode(), $this->details);
 }
 /**
  * @param Wiki    $wiki
  * @param Section $section
  * @param array   $changeSet
  */
 public function __construct(Wiki $wiki, $changeSet)
 {
     $details = array('wiki' => array('wiki' => $wiki->getId(), 'changeSet' => $changeSet));
     parent::__construct($wiki->getResourceNode(), $details);
 }
 /**
  * @param Wiki         $wiki
  * @param Section      $section
  * @param Contribution $contribution
  */
 public function __construct(Wiki $wiki, Section $section, Contribution $contribution)
 {
     $this->wiki = $wiki;
     $this->details = array('contribution' => array('wiki' => $wiki->getId(), 'section' => $section->getId(), 'id' => $contribution->getId(), 'title' => $contribution->getTitle(), 'text' => $contribution->getText(), 'contributor' => $contribution->getContributor()->getFirstName() . ' ' . $contribution->getContributor()->getLastName()));
     parent::__construct($wiki->getResourceNode(), $this->details);
 }
예제 #7
0
 /**
  * @param Wiki  $wiki
  * @param array $changeSet
  *
  * @return Controller
  */
 protected function dispatchWikiUpdateEvent(Wiki $wiki, $changeSet)
 {
     $event = new LogResourceUpdateEvent($wiki->getResourceNode(), $changeSet);
     return $this->dispatch($event);
 }