Buenas!
Primero una observación de tu código, tiene mal una comilla.
Igual supongo que fue un error al copiar y pegar, porque sino te tiraría un error de sintáxis.
array('label'=>'List reportes_lider_grupo', 'url'=>array('index', 'id'=>$user->id_usuario),'visible'=>Yii::app()->user->checkAccess('4')),
En cuanto al problema, el error te dice que querés acceder a una propiedad que no existe.
En efecto, $id_usuario no existe en la clase CWebUser (a la que te referís como $user, siendo realmente Yii::app()->user -el usuario de la aplicación-).
¿Podrías mostrar cómo tenés tu componente UserIdentity (protected/components/UserIdentity.php)?
Normalmente ahí definís una variable privada $_id y después le asignás el id del usuario de la tabla.
Tipicamente, esa clase se ve así:
<?php
/**
* UserIdentity represents the data needed to identity a user.
* It contains the authentication method that checks if the provided
* data can identity the user.
*/
class UserIdentity extends CUserIdentity
{
private $_id;
/**
* Authenticates a user.
* The example implementation makes sure if the username and password
* are both 'demo'.
* In practical applications, this should be changed to authenticate
* against some persistent user identity storage (e.g. database).
* @return boolean whether authentication succeeds.
*/
public function authenticate(){
$username = strtolower($this->username);
$user = User::model()->find('LOWER(username) = ?', array($username));
if($user === null){
$this->errorCode=self::ERROR_USERNAME_INVALID;
} else if(sha1($this->password) !== $user->password){
$this->errorCode=self::ERROR_PASSWORD_INVALID;
} else {
$this->_id = $user->id;
$this->username = $user->username;
$this->errorCode = self::ERROR_NONE;
}
return !$this->errorCode;
}
//
public function getId(){
return $this->_id;
}
}
Lo que te permitiría acceder a la propiedad $_id con $user->getId().
En tu caso:
array('label'=>'List reportes_lider_grupo', 'url'=>array('index', 'id'=>$user->getId()),'visible'=>Yii::app()->user->checkAccess('4')),
Te pregunto ¿por qué accedés a Yii::app()->user como $user?