authManager checkaccess

In UserRole model


 public function addRole(){

            $test=$this->RoleName;

            if (!Yii::app()->user->checkAccess($this->RoleName,$this->idUser))

            {

            $this->save();

            Yii::app()->authManager->assign($this->RoleName, $this->idUser, '');

            }

        }

The rolename im tying to insert is not in authassignment table but it not passes save!!!

Now im using instead "isAssigned" method because i saw that checkAccess is for operations but i get the same true condition


public function addRole(){

            

            if (!Yii::app()->authManager->isAssigned($this->RoleName,$this->idUser))

            {

                $this->save();

                Yii::app()->authManager->assign($this->RoleName, $this->idUser, '');

            }

        }