Yii :: Use Of Undefined Constant

I am using the below code in the accessRules() function to match the roles of the logged in user. The role is set during the authentication process using

$this->setState(‘role’, $record->role);

The code in the accessRules() function is:










return array(

    array('allow', 'actions'=>array('index','view'),




This code is working fine on my local machine but when I upload it to the server it gives me Use of undefined constant guest - assumed ‘guest’ error. What is the reason for this and how can I resolve this. Thanks!!!

FYI: The local machine is windows 7 and server is LINUX.

An where do you use the variable $role in your accessRules() function?