/** * Overwrite the `run` method to check admin permissions. */ public function run() { Request::init(); if (Request::seg(0) == 'admin' && !currentUser()->isAdmin()) { echo show403(); exit; } else { return parent::run(); } }
/** * Process the request. */ public function run() { Request::init(); $route = Router::process(); if ($route) { Kernel::process("{$this->path}/{$route}"); } else { throw new NoRouteFoundException(sprintf("No route matches [%s]", Request::$pathInfo)); } }