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 )


			$model->addChild($childName,$trade);

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();


                    $trade=0;


                    //for revoke in authassignment table


                    $itemName = $this->getItemName();


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


                    $x=  array_keys($item);


                    if($item)


                    {


                         for($i=0;$i<count($item);$i++)


                                       {


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


                                       }


                    } 


                    


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


			$model->addChild($childName);


                   


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


                    $this->addItemChildCreator($childName,$itemName,$trade);


             


                    


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


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


			$this->redirect(array('authItem/permissions'));


	}


	else


	{


		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)

    {


       $trade=0;


        Yii::app()->db->createCommand()


        ->update('authitemchild', array(


            'trade_company_id'=>$trade,


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


    }

Done It… :rolleyes: