By default, Yii is using user ID to check role assignment. So you need to change assign() call to use user ID, or extend CWebUser.checkAccess to check access using username.
By default, Yii is using user ID to check role assignment. So you need to change assign() call to use user ID, or extend CWebUser.checkAccess to check access using username.
Could i change my implementation of CUserIdentity to set id as username?
Got it to work if i used database id's in CDbAuthManager.assign, when i changed my CUserIdentity implementation and with CWebUser implementation.
Later feels like the correct solution Thanks qiang!
./protected/components/WebUser.php:
class WebUser extends CWebUser {
public function checkAccess($operation,$params=array()){
return Yii::app()->getAuthManager()->checkAccess($operation,$this->getName(),$params);
}
}