public function startup() { parent::startup(); if (!$this->getUser()->isAllowed($this->name, $this->view)) { $this->flashMessage('Access denied', 'error'); $this->redirect('Dashboard:'); } }