public function beforeControllerAction($controller, $action)
    {
        if (parent::beforeControllerAction($controller, $action)) {
            $user = Yii::app()->getUser();

            if ($user instanceof AuthWebUser) {
                if ($user->isAdmin) {
                    return true;
                } elseif ($user->isGuest) {
                    $user->loginRequired();
                }
            } else {
                throw new CException('WebUser component is not an instance of AuthWebUser.');
            }
        }
        throw new CHttpException(401, Yii::t('AuthModule.main', 'Access denied.'));
    }