Beispiel #1
0
 /**
  * 
  */
 protected function checkUserRights($page)
 {
     if ($this->user && !$this->isOwner) {
         if (!$this->user->hasRight($page)) {
             throw new AccessNotAllowedException();
         }
     }
 }
Beispiel #2
0
 /**
  * 
  * @param User $user
  * @return array
  */
 public function getItems(User $user = null)
 {
     if ($user === null) {
         return $this->items;
     }
     $items = [];
     foreach ($this->items as $item) {
         if ($item->getRight() == '' || $user->hasRight($item->getRight())) {
             $items[] = $item;
         }
     }
     return $this->trimSeparators($items);
 }