Beispiel #1
0
 /**
  * Checks whether the current user is authorized to perform a particular action.
  *
  * @param string $role
  * @param Page   $page
  */
 public function authorization($role, Page $page = null)
 {
     if (!Auth::isLoggedIn()) {
         abort(401);
     }
     if (!Auth::loggedIn($role, $page)) {
         abort(403);
     }
 }
Beispiel #2
0
 public function admin()
 {
     parent::admin();
     $this->page->setInternalName($this->request->input('internal_name'));
     if (Auth::loggedIn('edit_disable_delete', $this->page)) {
         $this->page->setDisableDelete($this->request->input('disable_delete') == '1');
     }
     Page::save($this->page);
 }
Beispiel #3
0
 public static function items()
 {
     $items = Config::get('boomcms.menu');
     foreach ($items as $key => $item) {
         if (isset($item['role']) && !Auth::loggedIn($item['role'])) {
             unset($items[$key]);
             continue;
         }
         $items[$key]['title'] = isset($item['title']) ? $item['title'] : Lang::get('boomcms::menu.' . $key);
     }
     usort($items, function ($a, $b) {
         if ($a['title'] === $b['title']) {
             return 0;
         }
         return $a['title'] < $b['title'] ? -1 : 1;
     });
     return $items;
 }
Beispiel #4
0
 public function authorization($role, Page $page = null)
 {
     if (!Auth::loggedIn('manage_pages')) {
         parent::authorization($role, $page);
     }
 }