i want to make some dynamic things to accessrules function in yii's controllers :
i want to give access to dynamic list of users to specific views, this list is imported from database.
I give an example (in controller) :
public function accessRules()
{
$users=array();
$usersFromDB= Account::model()->findAll();
foreach ($usersFromDB as $key=>$val)
{
$users[]=$val->name;
}
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array(),
'users'=>array('*'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete','deleteLogo'),
'users'=>$users,
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
But nothing works !
i thought that when i give a list of names to access rules it will take this list, but nothing happened.
P.S : controllers are generated with Gii

Help















