public static function getUserRole() { //role to user type mapping can be done using db table too. currently its written here in roleMap array if (Yii::app()->user->isGuest) { return false; } $userType = AppCommon::getUserType(); if ($userType !== false) { $roleMap = array("0" => "customer", "1" => "seller", "2" => "moderator", "3" => "administrator"); return $roleMap[$userType]; } else { return false; } }