/** * method to check if user is allowed to access page, if not redirect or show error message * * @param string $permission the permission required to the page * * @return boolean true if have access, else false * */ protected function allowed($permission) { if (self::authorized($permission)) { return true; } if (Billrun_Factory::user()) { $this->forward('error'); return false; } $this->forward('login', array('ret_action' => $this->getRequest()->getActionName())); return false; }