public function actionUpdate($name)
    {
        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        $item = $am->getAuthItem($name);

        if ($item === null) {
            throw new CHttpException(404, Yii::t('AuthModule.main', 'Page not found.'));
        }

        $model = new AuthItemForm('update');

        if (isset($_POST['AuthItemForm'])) {
            $model->attributes = $_POST['AuthItemForm'];
            if ($model->validate()) {
                $item->description = $model->description;

                $am->saveAuthItem($item);
                if ($am instanceof CPhpAuthManager) {
                    $am->save();
                }

                $this->redirect(array('index'));
            }
        }

        $model->name = $name;
        $model->description = $item->description;
        $model->type = $item->type;

        $this->render(
            'update',
            array(
                'item' => $item,
                'model' => $model,
            )
        );
    }