hasIdentity() || !$acl->isAllowed($auth->getIdentity()->userRole, 'admin', 'read')) { $this->_redirect('/'); exit; } } public function indexAction() { $posts = new ModelBlogPost(); $this->view->posts = $posts->fetchAll(); } }