public function _checkPermissions() { if (stripos($this->_request->getControllerName(), 'admin') === 0) { if ($this instanceof AdminAuthController) { return; } $admin = $this->getDi()->authAdmin->getUser(); if (!$admin) { throw new Am_Exception_InternalError("Visitor has got access to admin controller without admin authentication!"); } if (!$this->checkAdminPermissions($admin)) { throw new Am_Exception_AccessDenied("Admin [{$admin->login}] has no permissions to do selected operation in " . get_class($this)); } } }