Hi Leutz,
ich hab da mal ne frage zu den Accessrules
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'list' and 'show' actions
'actions'=>array('list','show'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','update'),
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete'),
'users'=>array('sebi'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
Und zwar würde ich gerne statt ‘users’ => array(‘sebi’)
‘roles’ => array(‘developer’, ‘admin’ … usw. )
dort verwenden, nur weis ich jetzt nicht wie yii das ganze verarbeitet,
wie sage ich yii denn das der user in der role admin drin ist?
Geht das auf diesem Weg überhaupt?
Und dann würde ich gerne diesen Link hier verstecken wenn der user
nicht in der role ist die in den accessRules drin steht
array(‘label’=>‘Posts verwalten’, ‘url’=>array(’/post/admin’))
der link befindet sich in der main.php(layouts)
und ich würde am liebsten von dort aus auf post.accessRules
zugreifen.
Wie gehe ich sowas jetzt am besten an?
Wie löst ihr soetwas?
gruß
sebi