Insert extra field in authitemchild table

Hello friends,

I am currently working on project. In which i used rights and user module. I add extra field "trade_comapny_id" in authitemchild table. Now at the time of assign permission when i click on assign link for any role it should insert trade_company_id into authitemchild with parant,child field.

I try to add in actionAssign() lines (AuthItemController)

                if( $childName!==null && $model->hasChild($childName)===false )


and also in (RDbAuthManager)

    public function addItemChild($itemName, $childName,$trade)



	// Make sure that the item doesn't already have this child.

	if( $this->hasItemChild($itemName, $childName,$trade)===false )

		return parent::addItemChild($itemName, $childName,$trade);


but it gives me error…

So is there any solution to insert extra fields???

Please help me…

Hey friends i solve it.

i called one function after

public function actionAssign()


if( Yii::app()->request->isPostRequest===true )


		$model = $this->loadModel();

		$childName = $this->getChildName();


                    //for revoke in authassignment table

                    $itemName = $this->getItemName();

                    $item = $this->_authorizer->authManager->getAssignmentsByItemName($itemName);

                    $x=  array_keys($item);





                                $this->_authorizer->authManager->assign($childName, $x[$i]);




		if( $childName!==null && $model->hasChild($childName)===false )



                    // by Dhara - add the trade_company_id - who logged in - in created by




		// if AJAX request, we should not redirect the browser

		if( isset($_POST['ajax'])===false )





		throw new CHttpException(400, Rights::t('core', 'Invalid request. Please do not repeat this request again.'));



in AuthItemController.

and the function in AuthItemController.

public function addItemChildCreator($childName,$itemName,$trade)




        ->update('authitemchild', array(


        ), 'child=:child and parent=:parent',      array(':child'=>$childName,':parent'=>$itemName));


Done It… :rolleyes: