How can I set the user’s role after I login him/her with
Yii::app()->user->login($identity, 0);
?
What I’m asking is how/what does this rule do to check if the user is logged in (@) and is administrator (admin)?
Code in a random controller:
public function accessRules()
{
return array(
array('allow',
'actions'=>array('users','user'),
'users'=>array('@'),
),
array('allow',
'actions'=>array('admin','delete'),
'users'=>array('admin'),
),
array('deny',
'users'=>array('*'),
),
);
}