用户注册时,Yii权限表不存储数据

时间:2015-03-02 06:58:11

标签: php yii yii-extensions

我已经做了很多尝试,查询是在用户模型中执行。我的数据是插入(user,authassignment,authitem,authitemchild)这些表中,但不会在Rights表中插入。

public function afterSave() {
    if ($this->isNewRecord) {
        $model = User::model()->findByPk($this->id);
        echo     $role = ucfirst($model->usertype); die;
        $authorizer = Yii::app()->getModule("rights")->getAuthorizer();
        $authorizer->authManager->assign($role, $this->id);
        return parent::afterSave();
    }
}

0 个答案:

没有答案
相关问题